Skip to content
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

ToolbarButton: Accepts both disabled and isDisabled props with different behavior #63070

Closed
mirka opened this issue Jul 2, 2024 · 0 comments · Fixed by #63101
Closed

ToolbarButton: Accepts both disabled and isDisabled props with different behavior #63070

mirka opened this issue Jul 2, 2024 · 0 comments · Fixed by #63101
Assignees
Labels
[Package] Components /packages/components [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@mirka
Copy link
Member

mirka commented Jul 2, 2024

ToolbarButton is intended to be disabled with the designated isDisabled prop, judging from the code and TypeScript types.

However, it also accepts the standard disabled prop because it allows standard <button> props via restProps. To complicate things further, the disabled prop in these restProps are first passed onto Ariakit.ToolbarItem before eventually being passed down to Button, which opts out the toolbar item from the roving tabindex set regardless of whether the underlying Button allows focusable disabled.

So to allow focusable disabled, you'll need to pass a combination of either disabled & accessibleWhenDisabled (Ariakit API which is undocumented in our docs), or isDisabled & __experimentalIsFocusable.

I'm not immediately sure how we'd want to address this, but things should be less confusing. We might want to tweak the logic so that passing disabled will result in the same behavior as passing isDisabled.


Related: #57701

@mirka mirka added [Type] Bug An existing feature does not function as intended [Package] Components /packages/components labels Jul 2, 2024
@mirka mirka self-assigned this Jul 2, 2024
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Components /packages/components [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant