-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
refactor(web-components): refactor menu to popover #31674
refactor(web-components): refactor menu to popover #31674
Conversation
📊 Bundle size report✅ No changes found |
6b8beb2
to
951b615
Compare
49e9093
to
113ae51
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great! One place where we'll want to remove the @floating-ui/dom
dependency as well is the tensile config for the benchmarks. There's a reference in there we can likely remove.
48b73f9
to
38adb86
Compare
A small interaction nit with menu: When clicking a menu to open it, keyboard navigation doesn't work. You have to redirect focus away from the control then back into it to use the keyboard. This isn't an issue with menu-list. |
Co-authored-by: John Kreitlow <[email protected]>
Co-authored-by: John Kreitlow <[email protected]>
Previous Behavior
The current Menu component has a hard dependency on
@floating-ui/dom
, this is an attempt to slim that down and leverage HTMLpopover
and CSSanchor
positioning.Also discovered:
New Behavior
This component has been refactored to use HTML
popover
and CSSanchor
positioning. HTMLpopover
is polyfillable and we're able to gracefully degrade CSSanchor
, so that's promising.Menu
to use the HTML[popover]
and CSSanchor
max-height
of dropdown (per request from Commerce UI Kit)MenuList
andMenuItem
to use[popover]
as well.@floating-ui/dom
dependency fromMenu
andMenuItem
Due to platform limitations with popover, we're unable to apply
popovertarget
tofluent-button
(because it's not a real<button>
) which would automate some of the show/hiding focus management and ARIA-expanded work, but have included workarounds.Known issues and TODOs
:focus-visible
not visible on first and last items in Safaricontextmenu
is a little futzyyarn change
package.json
Related Issue(s)