-
Notifications
You must be signed in to change notification settings - Fork 10k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Blazor] Prevent Rerender component when event occured #21088
Comments
@julienGrd thanks for contacting us.
Blazor will minify the changes to the DOM and you can further narrow this down by using
You can override That way you achieve the behavior where it can get turned off for individual events. |
Thanks for your reply @javiercn
I doesnt know this directive, its a really good idea !
i log into the afterrender of my GridRow the hashcode of my element (which is the key) when the onkeyup event is fire all my rows are re-rendered (on the log we see the hashcode of the object doesn't change) I can provide a reproducing example if you wan't
I don't really understand how i can achieve that ?
but at which time i can put my boolean back to true ? whats happen if a parameter change during this boolean is setted to false ? |
As a side note, this may be something relevant: #18919 |
Something like this should work:
|
Thank you for contacting us. Due to a lack of activity on this discussion issue we're closing it in an effort to keep our backlog clean. If you believe there is a concern related to the ASP.NET Core framework, which hasn't been addressed yet, please file a new issue. This issue will be locked after 30 more days of inactivity. If you still wish to discuss this subject after then, please create a new issue! |
Hello guys, a notice a behavior when i use event like keydown or keyup on a table for example, it make the component re-rendering each time event occured.
Most of a time, this behavior has no incidence but on a table full of data, it can make the performance really bad.
For example, if i suscribed on a keyup event on a table, to listen for example only the arrow up and the arrow down to have keyboard selection, it will make the reload each time i write on my keyboard
I read on the microsoft docs this is by design (i don't have the url but was something like "no need to call StateHasChanged on the event because the component will be automatically rerender")
I don't know if there is something to prevent this behavior, if not something like @onkeyup:noreload="true" would be perfect
thanks !
The text was updated successfully, but these errors were encountered: