Repository navigation
Make blur events on Blazor components non rendering - #3073
Merged
Merged
Conversation
mollykreis
marked this pull request as ready for review
September 28, 2026 20:15
rajsite
approved these changes
Sep 28, 2026
msmithNI
approved these changes
Sep 28, 2026
rajsite
enabled auto-merge (squash)
September 28, 2026 20:42
rajsite
disabled auto-merge
September 28, 2026 20:43
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
🤨 Rationale
The blur events on components in NimbleBlazor cause the component to re-render when they are fired. In most cases, this isn't a problem because the component re-rendering when it is blurred isn't noticeable. However, for some parent components (like the NimbleDialog), it causes problems because the whole subtree is re-rendered when the dialog is blurred. This means that if it is blurred by an action not represented in the component bindings, such as opening a select, that action is lost.
👩💻 Implementation
EventUtilitiesinternal static class to NimbleBlazor that is heavily based on Microsoft docs (only changes are to satisfy the repo's lint rules)EventUtilitieshelpers to keep the blur event firing from causing a component render🧪 Testing
Manually tested in the example app the known problematic scenario, which is multiple selects in a dialog. Without this change, opening a select takes 2 clicks because a blur event on the dialog causes the select to render immediately after it is opened (rendering in the closed state). With this change, that no longer occurs.
✅ Checklist