-
Notifications
You must be signed in to change notification settings - Fork 355
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
Slider: Rating Slider Example #1867
Conversation
Works on iOS using touch interface and also works with VoiceOver which announces the current and changes the number of stars. |
Yes, I had a problem with iOS device for the example. Thanks so much, Jon. |
New double A WCAG 2.2 target size success criteria. https://w3c.github.io/wcag/understanding/target-size-minimum.html "Targets that allow for values to be selected spatially based on position within the target are considered one target for the purpose of the success criterion. Examples include sliders with granular values, color pickers displaying a gradient of colors, or editable areas where you position the cursor." Therefore, the rating slider example does not have a conflict with WCAG target size rule. My big thanks to Alastair Campbell, @alastc for this info. |
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.
Visuals + a quick skim of the code look good to me.
Potentially in the future we could include a lighter shadow-fill effect on hover, but it's definitely not necessary before merging now 👍
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.
+1
Works well with VoiceOver in both Safari and Chrome on macOS.
5 stars! :)
Be careful with a lighter fill-effect, that can be an issue with non-text contrast, we even have that example in the docs. |
My only concern is when screenreader user navigates in browser mode there is no way for them to know that there are five stars. The aria-valuetext changes only when the user tabs to it in focus mode ( aria-valuetext="none of the five stars" ), otherwise it will be "two stars", no stars etc. |
…ion and keyboard blur event
Thank you for the reference, we are using a solid fill. |
@jongund This is looking good; thanks for your work on it. My only two concerns revolve around the wording of the default/zero value, and the changes that happen on focus/blur:
|
@jscholes wrote:
I agree with this. @jscholes wrote:
We made this change to be consistent with the seek slider where I believe we have general agreement that hearing the maximum value repeated every time the value changes creates excess and even distracting verbosity, making cognitive focus on the task of setting a new value more difficult. In the case of a seek slider, we should also keep in mind that excess verbosity detracts from media that might be playing while users are performing the seek task. So, the behavior we are proposing as ideal is to ensure that valuetext communicates the maximum when the page is loaded and any time the focus moves into the slider. To be sure that a reading cursor picks up the correct valuetext after focus moves away, the max is added to valuetext on blur. While this approach to minimizing distracting verbosity when communicating the maximum value via valuetext is a bit more complex than necessary for the rating slider, I think there is some value in consistency in guidance. Trying to explain when this small bit of fine tuning is really valuable verses a nice-to-have is more likely to create confusion. |
updated `aria-valuetext` values for zero stars
Fixed spelling errors
@jscholes |
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.
Editorial changes and review complete.
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.
Code and test review look good. |
I have created a new rating slider example based on the discussion at the 6 April 2021 meeting.
Features:
aria-hidden=true
on SVG elementforced-color-adjust
toauto
on the SVG element.stroke-opacity
andfill-opacity
instead oftransparent
values for setting stroke and fill colors for the SVGrect
used for focus ring for high contrast mode.Preview rating slider example
Review checklist