fix(material/slider): some screen readers announcing long decimal values - #20760
Merged
Conversation
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.
Member
Author
|
Caretaker note: this PR includes an input to allow people to override the |
wagnermaciel
self-requested a review
October 9, 2020 18:00
jelbourn
pushed a commit
that referenced
this pull request
Oct 20, 2020
…ues (#20760) 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 19f5f5c)
jelbourn
added a commit
to jelbourn/components
that referenced
this pull request
Oct 21, 2020
…imal values (angular#20760)" This reverts commit 19f5f5c. Reverting this for two reasons: * the truthiness check is a bit too broad, preventing someone from setting the empty string or zero * I'd prefer to have the input named `valuetext` rather than `aria-valuetext` since it's potentially confusing without supporting the `attr.` (I know we do this elsewhere, but I'd like to avoid more use of this pattern)
jelbourn
added a commit
that referenced
this pull request
Oct 22, 2020
…imal values (#20760)" (#20849) This reverts commit 19f5f5c. Reverting this for two reasons: * the truthiness check is a bit too broad, preventing someone from setting the empty string or zero * I'd prefer to have the input named `valuetext` rather than `aria-valuetext` since it's potentially confusing without supporting the `attr.` (I know we do this elsewhere, but I'd like to avoid more use of this pattern)
jelbourn
added a commit
that referenced
this pull request
Oct 22, 2020
…imal values (#20760)" (#20849) This reverts commit 19f5f5c. Reverting this for two reasons: * the truthiness check is a bit too broad, preventing someone from setting the empty string or zero * I'd prefer to have the input named `valuetext` rather than `aria-valuetext` since it's potentially confusing without supporting the `attr.` (I know we do this elsewhere, but I'd like to avoid more use of this pattern) (cherry picked from commit cc9758d)
|
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 had to be reverted because it was overriding people's
aria-valuetext. This PR includes an input that allows for it to be changed.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 1 with a step of 0.1, they end up reading out values like 0.20000068. These changes work around the issue by settingaria-valuetextto the same value that we shown in the thumb which we truncate ourselves.Fixes #20719.