-
Notifications
You must be signed in to change notification settings - Fork 13.4k
fix(select): use aria description for selected option within action sheet #30769
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
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
ShaneK
left a comment
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.
Looks good to me! Extremely minor grammatical nits, feel free to ignore if you don't wanna run CI just for them 🤷♂️
| const selectedOption = page.locator('.action-sheet-selected'); | ||
| await expect(selectedOption).toHaveAttribute('aria-description', 'selected'); | ||
|
|
||
| // Check that the attribut is not added to non-selected option |
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.
| // Check that the attribut is not added to non-selected option | |
| // Check that the attribute is not added to non-selected option |
| */ | ||
| configs({ modes: ['ios'], directions: ['ltr'] }).forEach(({ title, config }) => { | ||
| test.describe(title('select: aria attributes'), () => { | ||
| test('should have a aria-description on the selected option when action sheet interface is open', 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.
| test('should have a aria-description on the selected option when action sheet interface is open', async ({ | |
| test('should have an aria-description on the selected option when action sheet interface is open', async ({ |
Issue number: internal
What is the current behavior?
The screen reader does not announce when an option is selected within the action sheet interface. This is because the action sheet uses standard buttons, which do not support a detectable selected state via native properties or ARIA attributes like
aria-checkedoraria-selected, creating an inconsistent user experience across different interface types.What is the new behavior?
aria-description="selected"to the selected option. This will announce the option as "Oranges, button, selected".Downside: The text, "selected", is hard coded in. This causes an internationalization barrier since the text cannot be changed to another language.
Does this introduce a breaking change?
Other information
Basic