-
-
Notifications
You must be signed in to change notification settings - Fork 91
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
[useButton] Fix focusableWhenDisabled
components
#1313
[useButton] Fix focusableWhenDisabled
components
#1313
Conversation
focusableWhenDisabled
focusableWhenDisabled
✅ Deploy Preview for base-ui ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
d006ad4
to
eb2738a
Compare
eb2738a
to
a51cd51
Compare
|
const item = screen.getByText('two'); | ||
act(() => item.focus()); | ||
expect(item).toHaveFocus(); | ||
}); |
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.
Select
should now follow Menu
with useListNavigation
's disabledIndices
prop
I think this could also be fixed in this PR. The interaction hooks like |
b9f2cbb
to
04fa81c
Compare
* | ||
* @default false | ||
*/ | ||
disabled?: boolean; |
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.
Added back <Menu.RadioGroup disabled />
for consistency with regular RadioGroup
dbd21fc
to
38e5ab6
Compare
38e5ab6
to
b5ac66d
Compare
Fixed, it seems ok to have |
b5ac66d
to
6665fc1
Compare
focusableWhenDisabled
focusableWhenDisabled
components
@@ -117,6 +117,29 @@ describe('<Select.Item />', () => { | |||
}); | |||
}); | |||
|
|||
it('should focus disabled items', async () => { |
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.
It seems that hovering over disabled options doesn't focus them (unlike menu items)
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.
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.
@mj12albert yes, should be
Using
mergeReactProps
, our event handlers can't (easily) prevent external handlers since external ones are called first, it seems best to just bypass mergeReactProps here and manually call the externalonClick
.Additionally found these issues along the way and fixed them:
<Menu.RadioGroup disabled />
didn't work<Select.Trigger disabled />
didn't workCloses #1312