server side slider component
See original GitHub issueI have a question about implementation details of a slider component. Let say i have a code like
<div class="form-group"><label for="creditCardDebt" class="main__form-label">Credit Card Debt</label> <span> @ApplyFormModel.Debt.ToString("C") </span> <input type="range" min="0" max="30000" step="1000" id="creditCardDebt" class="form-control" @bind="@ApplyFormModel.Debt" @bind:event="oninput" /></div>
So when using Blazor server side every time i move a slider to another position i see a request to the server. Could it be a potential performance issue? Any best practices on how to implement such use case in a different manner? Thanks!
Issue Analytics
- State:
- Created 4 years ago
- Comments:16 (7 by maintainers)
Top Results From Across the Web
Slider | Server-Side Components | Framework
The Slider is a vertical or horizontal bar that allows setting a numeric value within a defined range by dragging a bar handle...
Read more >Slider component
The v-slider component can be used as an alternative visualization instead of a number input. #Usage. Sliders reflect a range of values along...
Read more >QuickStart | Vue Slider Component
Server -Side Rendering (SSR). Because the default imported file has inline styles, direct use will cause an error ( document is not defined...
Read more >React slider tutorial using react-slider
Learn how to create different sliders using react-slider, a React headless component that's easy to build and customize.
Read more >react-multi-carousel
Production-ready, lightweight fully customizable React carousel component that rocks supports multiple items and SSR(Server-side rendering).
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
thanks. i have already tried to use OnAfterRenderAsync and it worked just fine even without StateHasChanged call at all
protected override async Task OnAfterRenderAsync(bool firstRender) { if (firstRender == false) { if (ShowErrors) await JsRuntime.ScrollToElementId(“div-errors”); } }
For more details on the Blazor Components Lifecycle click here. To answer your question, I’d override the
OnAfterRenderAsync()
and make the call to scroll there. Remember the call toStateHasChanged()
should happens in the method you are making a request to the server.