Fix InputGroup hover state propagating to first button#444
Merged
pedromenezes1 merged 1 commit intomainfrom Apr 23, 2026
Merged
Fix InputGroup hover state propagating to first button#444pedromenezes1 merged 1 commit intomainfrom
pedromenezes1 merged 1 commit intomainfrom
Conversation
…idual mode HTML spec implicitly associates a <label> with its first labelable descendant, and browsers propagate :hover from the label to that control. When InputGroup contains multiple sibling labelable controls (e.g. Pagination.Controls with First/Prev/Next/Last buttons around an Input), hovering any button caused the first button to also render as hovered. Render the root as <div> when focusMode === "individual" (multiple sibling controls), matching the existing hybrid-mode behavior. Container mode (single input + addons) still renders as <label> so click-to-focus affordance is preserved.
commit: |
Contributor
Docs PreviewCommit: |
Contributor
Collaborator
Author
|
/bonk |
Contributor
|
The lint/typecheck failures are pre-existing infrastructure issues (missing generated files in the Review SummaryThis PR fixes a subtle but significant browser behavior issue where Changes Analysis
Tests (+63 lines across 2 files):
Visual Regression ReportThe visual regression shows only 1 minor change (0.01% pixel diff in "Input Group Loading"), which appears to be a timing/rendering artifact unrelated to this fix. ✅ ApprovalThis is a well-crafted fix that:
The PR is ready to merge. |
mattrothenberg
approved these changes
Apr 23, 2026
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.



Hovering any button inside
InputGroup(most visibly inPagination.Controls) made the first button also appear hovered. The root cause:InputGrouprendered as a<label>, and the HTML spec implicitly associates a<label>with its first labelable descendant, so browsers propagate:hoverfrom the label to that control.This renders the root as
<div>whenInputGroupcontains multiple sibling labelable controls (focusMode === "individual", matching the existing hybrid-mode behavior). Container mode (single input + addons) still renders as<label>so click-to-focus is preserved.button.matches(':hover')only returns true for the actually-hovered button after the fix