-
Notifications
You must be signed in to change notification settings - Fork 350
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
Color Viewer Slider: Improve high contrast support, touch AT support, and APG code quality guidelines support #1746
Conversation
@jongund There seem to be 2 extra files accidentally committed to this PR?
Edit 1: Never mind - sorry. The heading above those 2 files says, "Unchanged files with check annotations". So I see that they weren't accidentally committed. They're just suddenly failing for some reason. That's pretty annoying, because it's distracting and confusing. @nschonni Can we turn off whatever github feature is making those files show up in Jon's PR? Edit 2: Never mind, Nick! I forgot that you already created PR #1728 to fix this! |
@carmacleod |
Wow, Jon! Not only does this work better on touch, it actually works really well! The sliders slide beautifully. 🎉 Pointer-events are awesome! Also, as @patrickhlauke discovered, this actually works with VoiceOver now, too!! Not quite sure how VoiceOver is controlling the slider, though. The AOM user actions table says that slider increment/decrement should synthesize arrow key events, but that doesn't explain what's going on here because:
So is the platform using synthesized pointer events to control the slider? @cookiecrook Do you know if iOS/iPadOS/VO has implemented something to make ARIA sliders work? |
It does indeed seem that Safari/VO now fires faked keyboard events. The reason why the old/current slider example doesn't work is because VO sends left/right arrow fake key events for the horizontal slider, but the current slider example listens for up/down arrow. TalkBack on Android doesn't seem to fire these fake events, but seems to have implemented some other sort of accommodation, allowing users to double-tap and hold, and then slide left/right while holding the finger down to change the value. However, it only announces the percentage of the slider, not the actual value text. Also, it seems for some reason - at least in my testing - that the entire slider doesn't get announced at all unless it's been double-tapped to activate it. Really not sure what is going on there... |
Thanks for confirming that it's key events being faked! I see the difference between the old APG slider and the one in this PR. However, there's still something mysterious, because the preview slider in PR #1721 was also updated to use The only potentially relevant difference I can see is that the working slider in this PR hooks keydown on one additional element - an svg text element that is displaying the valuenow - but I don't see how that could be the important difference.
Good to know that TalkBack kinda-sorta works also.
Seems to be a TalkBack bug. Even happens with range input, according to this blog post.
Agreed that this is weird and seems buggy. Is this still the only way to report TalkBack bugs? |
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.
This is an approving Functional review for Windows, Mac, iOS, and iPadOS,
and an approving Accessibility review for Jaws/NVDA in Chrome/Edge/Firefox.
Keyboard works well on Windows and Mac (used Fn+arrows for PageUp, PageDown, Home, End on Mac),
and left-right tap and drag gestures work well on iOS and iPadOS.
Nice work, Jon! This is vastly improved from what was there before. Thank-you so much for your perseverance!
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.
Looks good! Just one issue in the tests, where it looks like some lines were (likely accidentally) removed.
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.
Touch gesture in Android Talkback is a bit flaky(See above comments). However, it seems to be working. I was also able to "seek control" setting in Android to add actual percentage for RGB value.
@jongund |
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.
This is approving editorial review.
I've finished edits for editorial review. It'd be good for people to have a final look at the warning at the top and the accessibility features just to make sure I don't have any typos or the like. Otherwise, this is, I believe, ready to ship! |
@jongund |
@a11ydoer for the Android issues it is probably worth re-testing with chrome 90. There are a bunch of input type=range bug fixes in there which could help |
Thank you @jongund for leading the work to make this awesome set of improvements!!! |
… and APG code quality guidelines support (w3c#1746) Makes the following changes to the color viewer slider example: * Align with current APG code quality guidelines, including using a single object for the color viewer. * Use SVG graphic elements instead of HTML elements for the visual rendering. * Use currentColor value for SVG stroke property to support high contrast modes in operating systems. * Use event.key instead of event.keyCode for responding to keyboard events, which also provides support for iOS and Android screen readers. * Updated focus styling to have a ring around the thumb. * Use pointer events instead of mouse events, which provides support for moving the slider thumb with touch. * Added group role and accessible name for the color viewer widget. Co-authored-by: Matt King <[email protected]>
… and APG code quality guidelines support (w3c#1746) Makes the following changes to the color viewer slider example: * Align with current APG code quality guidelines, including using a single object for the color viewer. * Use SVG graphic elements instead of HTML elements for the visual rendering. * Use currentColor value for SVG stroke property to support high contrast modes in operating systems. * Use event.key instead of event.keyCode for responding to keyboard events, which also provides support for iOS and Android screen readers. * Updated focus styling to have a ring around the thumb. * Use pointer events instead of mouse events, which provides support for moving the slider thumb with touch. * Added group role and accessible name for the color viewer widget. Co-authored-by: Matt King <[email protected]>
Updated color viewer slider based on the results slider update focus group meeting.
Changes:
fill
of the railrect
to indicate the color the slider is associated with. Thefill
to the left of the thumb is the color associated with the slider.currentColor
value for SVGstroke
property to support high contrast modes in operating systems.event.key
, instead ofevent.keyCode
for responding to keyboard events.pointer
instead ofmouse
events for moving the slider thumb to support touch devices.group
role and accessible name for the color viewer widget.Preview link of color viewer slider