[Blazor] Add a way to indicate event handler should not call StateHasChanged #22236
Labels
area-blazor
Includes: Blazor, Razor Components
✔️ Resolution: Duplicate
Resolved as a duplicate of another issue
Status: Resolved
When adding
@onmousemove=MouseHasMoved
to an element Blazor will re-render the component every time theMouseHasMoved
method finishes executing.Preventing this using
ShouldRender
is tricky, because the component might need to render for other reasons, and having to set some state for every scenario that causes a re-render is labourious.Could we have a way of telling Blazor not to add a call to StateHasChanged. Perhaps something like this
@onmousemove:preventStateHasChanged
@onmousemove:preventStateHasChanged=true
@onmousemove:preventStateHasChanged=LeftMouseButtonIsHeldDown
The text was updated successfully, but these errors were encountered: