-
Notifications
You must be signed in to change notification settings - Fork 647
[a11y] When aria-disabled is set on SegmentedControl, don't allow action #7047
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 all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
27b3a27
Ensure that when aria-disabled is set, the selected tab doesn't change
khiga8 94c4b25
Add `disabled` prop to `SegmentedControl.Button`
TylerJDev 46f8beb
Re-introduce the reverted "Clean up the feature flag for `primer_reac…
khiga8 57f988d
Merge branch 'main' into kh-segmented-control
khiga8 c2aad6e
Update strong-mangos-rest.md
khiga8 af99208
Update packages/react/src/SegmentedControl/SegmentedControl.examples.…
khiga8 307289d
Update .changeset/strong-mangos-rest.md
khiga8 088b051
Update SegmentedControl.dev.stories.tsx
khiga8 528e05a
Aria-disabled and disabled (#6725)
khiga8 3b6eefe
Merge branch 'main' into kh-segmented-control
TylerJDev 9acdcc4
Add styles
TylerJDev d99fc85
Run format
TylerJDev 3984849
Remove `:hover` and `:active` styles when disabled
TylerJDev 3b95781
Move `:not`
TylerJDev 9ff45d6
Fix lint
TylerJDev af884b0
Merge branch 'main' into kh-segmented-control
TylerJDev c31274e
Merge branch 'main' into kh-segmented-control
TylerJDev 154deb0
Merge branch 'main' into kh-segmented-control
hectahertz 6eeecc9
Merge branch 'main' into kh-segmented-control
TylerJDev fe20f4f
Lint fix
TylerJDev 30ecae0
Changes from feedback
TylerJDev 9f7a7f5
Merge branch 'main' into kh-segmented-control
TylerJDev b27cd1c
Add to VRT
TylerJDev 9d52fb7
test(vrt): update snapshots
TylerJDev 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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| --- | ||
| "@primer/react": minor | ||
| --- | ||
|
|
||
| Remove the feature flag for `primer_react_segmented_control_tooltip` and GA tooltip by default behavior. | ||
| - Ensure that when `disabled` is applied, the tooltip is still triggered. |
Binary file added
BIN
+8.3 KB
...t.ts-snapshots/SegmentedControl-With-Disabled-Buttons-dark-colorblind-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+8.25 KB
....test.ts-snapshots/SegmentedControl-With-Disabled-Buttons-dark-dimmed-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+8.35 KB
...s-snapshots/SegmentedControl-With-Disabled-Buttons-dark-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+8.3 KB
...Control.test.ts-snapshots/SegmentedControl-With-Disabled-Buttons-dark-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+8.3 KB
...t.ts-snapshots/SegmentedControl-With-Disabled-Buttons-dark-tritanopia-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+8.32 KB
....ts-snapshots/SegmentedControl-With-Disabled-Buttons-light-colorblind-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+8.36 KB
...-snapshots/SegmentedControl-With-Disabled-Buttons-light-high-contrast-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+8.32 KB
...ontrol.test.ts-snapshots/SegmentedControl-With-Disabled-Buttons-light-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+8.32 KB
....ts-snapshots/SegmentedControl-With-Disabled-Buttons-light-tritanopia-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
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
22 changes: 22 additions & 0 deletions
22
packages/react/src/SegmentedControl/SegmentedControl.examples.stories.tsx
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| import type {Meta} from '@storybook/react-vite' | ||
| import {SegmentedControl} from '.' | ||
| import {EyeIcon, FileCodeIcon, PeopleIcon} from '@primer/octicons-react' | ||
|
|
||
| export default { | ||
| title: 'Components/SegmentedControl/Examples', | ||
| component: SegmentedControl, | ||
| } as Meta<typeof SegmentedControl> | ||
|
|
||
| export const WithDisabledButtons = () => ( | ||
| <SegmentedControl aria-label="File view"> | ||
| <SegmentedControl.Button defaultSelected aria-label={'Preview'} leadingIcon={EyeIcon} disabled> | ||
| Preview | ||
| </SegmentedControl.Button> | ||
| <SegmentedControl.Button aria-label={'Raw'} leadingIcon={FileCodeIcon}> | ||
| Raw | ||
| </SegmentedControl.Button> | ||
| <SegmentedControl.Button aria-label={'Blame'} leadingIcon={PeopleIcon} aria-disabled={true}> | ||
| Blame | ||
| </SegmentedControl.Button> | ||
| </SegmentedControl> | ||
| ) | ||
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
does this need VRT?
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.
Yeah! I'll add one.
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 be added now!