Repository navigation
[menu][combobox] Pass the originating event to onItemHighlighted - #5838
Merged
Merged
Conversation
commit: |
Bundle size
PerformanceTotal duration: 397.63 ms ▼-138.88 ms(-25.9%) | Renders: 76 (+0) | Paint: 718.52 ms ▼-267.77 ms(-27.1%)
…and 6 more (+4 within noise) — details Check out the code infra dashboard for more information about this PR. |
✅ Deploy Preview for base-ui ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
atomiks
force-pushed
the
highlight-event
branch
from
October 1, 2026 12:22
3029e59 to
c97b88b
Compare
atomiks
marked this pull request as ready for review
October 2, 2026 04:18
atomiks
requested review from
aarongarciah,
colmtuite,
flaviendelangle,
jjenzz and
michaldudak
as code owners
October 2, 2026 04:18
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.
onItemHighlightedin Menu and Combobox always received a placeholdernew Event('base-ui'), even though the types map'keyboard'toKeyboardEventand'pointer'toPointerEvent. After ArrowDown,details.event.keywasundefinedanddetails.event.getModifierState()threw.This PR passes the originating native event through for keyboard and pointer highlights (arrow keys, typeahead, hover, chip removal, and the filterable menu's input and submenu keys). Highlights without an originating event keep the placeholder, which matches their
Eventtype. The public highlight event types now acceptMouseEvent | PointerEventfor the'pointer'reason: hover supplies a mouse event, while leaving an item supplies a pointer event. This override is scoped to highlight notifications; the shared pointer-event mapping is unchanged.Every reason is now derived from the event that caused it, so a
'keyboard'reason always carries aKeyboardEvent. Combobox drops its last-used-input flag, so clearing the highlight by typing or withCombobox.Clearnow reports'none'instead of'keyboard'/'pointer', and hovering after keyboard navigation reports'pointer'. Opening a filterable submenu with Enter or Space also reports'none', since its click carries no key.Note:
preventDefault()andstopPropagation()called insideonItemHighlightedmay now take effect, because discrete-event updates flush before the keydown finishes dispatching.