-
-
Notifications
You must be signed in to change notification settings - Fork 95
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
[Tabs][RadioGroup] Handle modifier keys #1529
base: master
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for base-ui ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
bee18f6
to
84117fc
Compare
e11041c
to
f1a7674
Compare
f1a7674
to
8fb06fe
Compare
8fb06fe
to
bcf14fe
Compare
@@ -76,6 +94,7 @@ export function useCompositeRoot(params: UseCompositeRootParameters) { | |||
enableHomeAndEndKeys = false, | |||
stopEventPropagation = false, | |||
disabledIndices, | |||
modifierKeys = [], |
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.
Should this default be specified outside so it's a stable reference?
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.
👍 ~ fixed
Fixes #1465
All composite components will now prevent arrow key navigation if any modifier key (Shift, Ctrl, Alt, Meta) is pressed by default unless it's allowed with the
modifierKeys
prop.The exception is RadioGroup since HTML radio groups work normally when
Shift
is held (example)Demo:
Tabs will no longer navigate if any modifier key is pressed: https://deploy-preview-1529--base-ui.netlify.app/react/components/tabs
RadioGroup works normally if
Shift
is pressed: https://deploy-preview-1529--base-ui.netlify.app/react/components/radioI have followed (at least) the PR section of the contributing guide.