-
Notifications
You must be signed in to change notification settings - Fork 6.8k
fix(material/slider): some screen readers announcing long decimal values #20870
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(material/slider): some screen readers announcing long decimal values #20870
Conversation
Caretaker note: these changes have been reverted twice before, because there's an app whose |
It looks like some screen readers announce the value of a slider by calculating the percentage themselves using the `aria-valuemin`, `aria-valuemax` and `aria-valuenow`. The problem is that they don't round down the decimals so for a slider between 0 and 1 with a step of 0.1, they end up reading out values like 0.20000068. These changes work around the issue by setting `aria-valuetext` to the same value that we shown in the thumb which we truncate ourselves. Fixes angular#20719.
cd18d8f
to
97b90d7
Compare
Reworked based on the feedback and added another test case. |
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.
LGTM
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.
LGTM
…ues (#20870) It looks like some screen readers announce the value of a slider by calculating the percentage themselves using the `aria-valuemin`, `aria-valuemax` and `aria-valuenow`. The problem is that they don't round down the decimals so for a slider between 0 and 1 with a step of 0.1, they end up reading out values like 0.20000068. These changes work around the issue by setting `aria-valuetext` to the same value that we shown in the thumb which we truncate ourselves. Fixes #20719. (cherry picked from commit 9f4415e)
…ues (#20870) It looks like some screen readers announce the value of a slider by calculating the percentage themselves using the `aria-valuemin`, `aria-valuemax` and `aria-valuenow`. The problem is that they don't round down the decimals so for a slider between 0 and 1 with a step of 0.1, they end up reading out values like 0.20000068. These changes work around the issue by setting `aria-valuetext` to the same value that we shown in the thumb which we truncate ourselves. Fixes #20719. (cherry picked from commit 9f4415e)
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Note: this is a resubmit of #20721 which renames the
aria-valuetext
input tovalueText
based on the note in #20849.It looks like some screen readers announce the value of a slider by calculating the percentage themselves using the
aria-valuemin
,aria-valuemax
andaria-valuenow
. The problem is that they don't round down the decimals so for a slider between 0 and 1with a step of 0.1, they end up reading out values like 0.20000068. These changes work around the issue by setting
aria-valuetext
to the same value that we shown in the thumb which we truncate ourselves.Fixes #20719.