fix(material/slider): some screen readers announcing long decimal values - #20870
Merged
annieyw merged 1 commit intoNov 4, 2020
Merged
Conversation
Member
Author
|
Caretaker note: these changes have been reverted twice before, because there's an app whose |
jelbourn
reviewed
Oct 26, 2020
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.
crisbeto
force-pushed
the
slider-value-text-3-revenge-of-the-sith
branch
from
October 26, 2020 17:15
cd18d8f to
97b90d7
Compare
Member
Author
|
Reworked based on the feedback and added another test case. |
annieyw
pushed a commit
that referenced
this pull request
Nov 4, 2020
…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)
annieyw
pushed a commit
that referenced
this pull request
Nov 4, 2020
…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. |
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Note: this is a resubmit of #20721 which renames the
aria-valuetextinput tovalueTextbased 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-valuemaxandaria-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-valuetextto the same value that we shown in the thumb which we truncate ourselves.Fixes #20719.