-
-
Notifications
You must be signed in to change notification settings - Fork 321
[menu][popover][combobox] Fix focus guard handling #3654
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
base: master
Are you sure you want to change the base?
Conversation
commit: |
Bundle size report
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. |
79b8d8c to
5ccff51
Compare
| let nextTabbable = getTabbableAfterElement( | ||
| store.context.triggerFocusTargetRef.current || triggerElementRef.current, | ||
| ); |
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.
In Safari, aria-hidden={false} on the focus guard, so it should look for next tabbable starting from (after) the focus guard
|
|
||
| const focus = useFocus(floatingRootContext, { | ||
| enabled: !disabled && ((!isInMenubar && isOpenedByThisTrigger) || parentMenubarHasSubmenuOpen), | ||
| enabled: !disabled && parentMenubarHasSubmenuOpen, |
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 otherwise causes Shift + Tab not to close the popup when focus lands back on the trigger in Menu; seems to still pass all Menubar tests
fef44c4 to
5b5d512
Compare
LukasTy
left a comment
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.
Looks great. 👍
Very nice improvement when running on Safari.
However, have you checked Firefox? It is broken with tabbing to an after (Tab) element, only works with before (Shift+Tab). 🤷
Fixes a couple of issues with the focus guards:
https://deploy-preview-3654--base-ui.netlify.app/experiments/popup-tabbing