Skip to content

Conversation

@thetaPC
Copy link
Contributor

@thetaPC thetaPC commented Nov 5, 2025

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-checked or aria-selected, creating an inconsistent user experience across different interface types.

What is the new behavior?

  • Added an aria-description="selected" to the selected option. This will announce the option as "Oranges, button, selected".
  • Added test.

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?

  • Yes
  • No

Other information

Basic

@github-actions github-actions bot added the package: core @ionic/core package label Nov 5, 2025
@vercel
Copy link

vercel bot commented Nov 5, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
ionic-framework Ready Ready Preview Comment Nov 5, 2025 8:43pm

@thetaPC thetaPC changed the title Fw 6818 fix(select): use aria description for selected option Nov 5, 2025
@thetaPC thetaPC changed the title fix(select): use aria description for selected option fix(select): use aria description for selected option within action sheet Nov 5, 2025
@thetaPC thetaPC marked this pull request as ready for review November 5, 2025 21:11
@thetaPC thetaPC requested a review from a team as a code owner November 5, 2025 21:11
@thetaPC thetaPC requested a review from gnbm November 5, 2025 21:11
Copy link
Member

@ShaneK ShaneK left a 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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// 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 ({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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 ({

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: core @ionic/core package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants