Skip to content

EES-5912 Prevent screenreader announcing unavailable after button click #5737

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 2 commits into from
Apr 4, 2025

Conversation

Guy-HiveIT
Copy link
Collaborator

Don't set aria-disabled to true during 'double click prevention' phase, as this causes screen readers to announce 'unavailable' immediately on button click.
aria-disabled can still be passed in as a prop, as well as disabled

Don't set aria-disabled to true during 'double click prevention' phase
Copy link
Collaborator

@bennettstuart bennettstuart left a comment

Choose a reason for hiding this comment

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

Simple and effective

@bennettstuart
Copy link
Collaborator

There's a bunch of tests failing, here's just one example

FAIL src/components/__tests__/ModalConfirm.test.tsx
// ...
expect(
src/explore-education-statistics-common test:ci:       34 |         screen.getByRole('button', { name: 'Confirm' }),
src/explore-education-statistics-common test:ci:     > 35 |       ).toBeAriaDisabled();

Copy link
Collaborator

@bennettstuart bennettstuart left a comment

Choose a reason for hiding this comment

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

Failing tests need investigating

@Guy-HiveIT Guy-HiveIT requested a review from bennettstuart April 3, 2025 09:51
@bennettstuart bennettstuart merged commit 746f2f5 into dev Apr 4, 2025
11 checks passed
@bennettstuart bennettstuart deleted the EES-5912-button-sr-aria-disabled-fix branch April 4, 2025 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants