-
Notifications
You must be signed in to change notification settings - Fork 4.7k
ToggleGroupControl: support disabled options
#63450
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
c01f777
Add disabled option tests
ciampo 9546243
Fix handling of disabled prop on ToggleGroupControl options
ciampo ceebf66
Add basic disabled styles
ciampo a1cf315
Update snapshots
ciampo ea67533
CHANGELOG
ciampo 62959f0
Support accessibleWhenDisabled for ratio option items
ciampo 1d71066
Support accessibleWhenDisabled for button option items
ciampo 8515e58
Update snapshots
ciampo 0ee013e
Update tests to reflect that options are keyboard focusable while dis…
ciampo 8172ca6
Move CHANGELOG entry to enhancements section
ciampo fe854cf
Revert "Support accessibleWhenDisabled for ratio option items"
ciampo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix handling of disabled prop on ToggleGroupControl options
- Loading branch information
commit 95462434b647d3a0c3ccd442749b1f5e8c07f774
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
I don't think it makes sense to have the options
accessibleWhenDisabledgiven how the component works cc @mirkaThere 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.
I actually thought this was one of the cases where we always want the option to be focusable when disabled, similar to ToolbarButton (#63102) or tabs in a tablist. It's also a composite widget where there will be a limited number of options, and the number of tab stops it potentially adds to the tab sequence is either zero or negligible.
Implementing that in the radio case for ToggleGroupControl would require some additional design work though 🤔 But at least Ariakit supports the behavior nicely (StackBlitz demo).
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.
Yep. Currently, since
disabledoptions are not really supported, the backdrop indicator also works as a focus indicator.If we make the options
accessibleWhenDisabled, then we'll need to add separate focus rings.Yup. We'll probably need to add the custom logic when rendering individual
buttons