-
-
Notifications
You must be signed in to change notification settings - Fork 10.1k
UI: Make disabled Buttons keyboard-focusable #34166
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
6 commits
Select commit
Hold shift + click to select a range
01b1051
fix(a11y): replace native disabled with isDisabled and aria-disabled …
WioletaKolodziej cff53d2
Finalise Button aria-disabled changes
Sidnioulz 92c9867
Adjust remaining tests using toBeDisabled
Sidnioulz 585d934
Fix mistake in E2E test locator
Sidnioulz 9e58af5
Merge branch 'next' into sidnioulz/issue-31678-aria-disabled-finish
Sidnioulz 609f377
Merge branch 'next' into sidnioulz/issue-31678-aria-disabled-finish
Sidnioulz 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
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
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
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.
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.
🧩 Analysis chain
🏁 Script executed:
Repository: storybookjs/storybook
Length of output: 1609
🏁 Script executed:
Repository: storybookjs/storybook
Length of output: 1293
🏁 Script executed:
# Read from the very top of the file to find imports and component definitions head -60 code/core/src/component-testing/components/test-fn.stories.tsxRepository: storybookjs/storybook
Length of output: 1474
🏁 Script executed:
Repository: storybookjs/storybook
Length of output: 47
🏁 Script executed:
Repository: storybookjs/storybook
Length of output: 360
🏁 Script executed:
Repository: storybookjs/storybook
Length of output: 153
🏁 Script executed:
Repository: storybookjs/storybook
Length of output: 92
🏁 Script executed:
Repository: storybookjs/storybook
Length of output: 691
🏁 Script executed:
# Check the test/index.ts to see what rawExpect is cat code/core/src/test/index.tsRepository: storybookjs/storybook
Length of output: 1658
🏁 Script executed:
# Check expect.ts to see what's exported cat code/core/src/test/expect.tsRepository: storybookjs/storybook
Length of output: 4374
🏁 Script executed:
Repository: storybookjs/storybook
Length of output: 47
🏁 Script executed:
Repository: storybookjs/storybook
Length of output: 191
🌐 Web query:
@testing-library/jest-dom 6.9.1 toBeEnabled matcher💡 Result:
In @testing-library/jest-dom v6.9.1,
toBeEnabled()is available and is defined as the logical inverse oftoBeDisabled()(i.e. it’s equivalent toexpect(element).not.toBeDisabled()but avoids double-negation). It considers an element disabled when it’s a disable-able form control with thedisabledattribute or it’s inside a disabled ancestor that can disable descendants (e.g. a<fieldset disabled>), and therefore considers it enabled when those conditions are not true. It does not takearia-disabledinto account. [1]Example:
The 6.9.1 release itself is a small bugfix release (unrelated to
toBeEnabledbehavior). [2]Sources: [1] [2]
Replace
aria-disabledassertions withtoBeEnabled()for native buttons.Lines 99, 109, and 123 check
not.toHaveAttribute('aria-disabled', 'true'), but for native<button>elements, the actual enabled state is determined by the nativedisabledattribute or disabled fieldset ancestor, not thearia-disabledaccessibility attribute. UsetoBeEnabled()instead to verify the button's actual enabled behavior.Suggested patch
📝 Committable suggestion
🤖 Prompt for AI Agents