-
Notifications
You must be signed in to change notification settings - Fork 86
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
fix(character-count): prevent screen reader announcing value when submitting a form #6792
Merged
Conversation
This file contains 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
DipperTheDan
force-pushed
the
FE-6054_character-count-aria-live-fix
branch
from
June 20, 2024 09:42
17fb574
to
313ee41
Compare
tomdavies73
reviewed
Jun 25, 2024
Parsium
reviewed
Jun 25, 2024
DipperTheDan
force-pushed
the
FE-6054_character-count-aria-live-fix
branch
2 times, most recently
from
June 25, 2024 15:25
0174d81
to
6483ec9
Compare
Parsium
approved these changes
Jun 25, 2024
tomdavies73
approved these changes
Jun 25, 2024
Did a review of this with @tempertemper, all good 👍 |
ZhuoyuJin
approved these changes
Jul 3, 2024
…mitting a form This work fixes a bug whereby a screen reader announces the character count 'You have `n` characters remaining' message after form submission. To address this, we have defaulted aria-live to off until the input is focused where it will then have the value of polite. fixes #6181
DipperTheDan
force-pushed
the
FE-6054_character-count-aria-live-fix
branch
from
July 4, 2024 09:41
6483ec9
to
17ff11f
Compare
🎉 This PR is included in version 140.1.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This work fixes a bug whereby a screen reader announces the character count 'You have
n
characters remaining' message after form submission. To address this, we have defaulted aria-live to off until the input is focused where it will then have the value of polite.fixes #6181
Proposed behaviour
Default aria-live value is
off
until the input is focused where it will then have the value ofpolite
. Once the input is blurred, the aria-live value will be reset tooff
.Current behaviour
By default, the aria-live value is always
polite
.Checklist
d.ts
file added or updated if requiredQA
Additional context
N/A
Testing instructions
I have created a test story in Form called
Mock form for aria live demo
. In this demo you should check:off
by default (you can find this value by looking at thediv
element withdata-element="visually-hidden-character-count"
). When the input is focused, the aria-live value should change topolite
.Save
button, there should be no update provided regarding the character counts in any of the inputs.