Skip to content
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

Accessibility Updates: Shift-Tab, div order, and button names #4435

Merged
merged 9 commits into from
May 23, 2018

Conversation

pbblair
Copy link
Contributor

@pbblair pbblair commented Nov 13, 2017

Fixes:

  1. Previously Safari couldn't shift-tab, and now it can. Added a check so Pixi won't be tricked by false positives for mouse movements.
  2. Previously the fallback logic was broken for buttons without titles or hints. A correction and a few extra checks mean it should now work as intended on all major browsers.
  3. Previously buttons were in reverse order in the DOM. Braille displays make use of that order and would show buttons in backwards-order. Flipped this around (also makes debugging a little more intuitive).

Enhancement:
3. One of the first things I tried to do with Pixi accessibility was to update a button name to reflect a button's state change, but it had no effect when I tried. The official Pixi demo is a great example of this need! Buttons are toggled to light up the signs, but there's no indication of the button's new state. I've added this functionality.

Live demo at:
http://superkeen.com/web/pixi

To get as many browser/screenreader combinations as possible to announce the change as soon as its made, I've added some ARIA attributes. I've done quite a bit of testing to reveal how well this is supported. See below for details:

Full support:
Windows Chrome (Narrator and NVDA)
Windows Firefox (Narrator and NVDA)
Windows IE (NVDA)

Partial support:
Mac Safari (Voiceover): fine until the focus leaves and returns to the page, then button name changes not announced right away, only on focus change; recoverable by restarting Voiceover
Win/Mac/ChromeOS Chrome (ChromeVox): when toggling, sometimes announces the old button name instead of the new one

No button name change support (just like legacy behavior):
Mac Chrome (Voiceover)
Mac Firefox (Voiceover)
Windows Chrome (JAWS)
Windows Firefox (JAWS)
Windows IE (Narrator and JAWS)
Windows Edge (Narrator, NVDA, JAWS)

Safari triggers onMouseMOve when the user presses shift (or any modifier).  Added a check to ensure the user really did move the mouse.  Shift-tab now works in Safari.
Previously if buttons were not given names, things like 'null' and 'undefinied' were making their way into the screen reader and browser tooltips.  DId a thorough multi-browser review and this should make the originally desired fallback work in all cases.
Previously if a Pixi game updated its accessibleTitle or accessibleHint after its initial creation, the change would not be reflected in the DOM.  Now, in these cases, it updates properly and also prioritizes any changes to the focused button to the scren reader.
@pbblair pbblair changed the title Accessibility Fixes: Safari Shift-Tab and fallback names for buttons Accessibility Updates: Shift-Tab, button naming fallback and naming updates Nov 13, 2017
Copy link
Collaborator

@ivanpopelyshev ivanpopelyshev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/pixijs/pixi.js/blob/dev/src/accessibility/accessibleTarget.js

According to this file, there cant be undefined in hint. I dont like usage of both "!== undefined" and "!== null", its making code less readable :( Leave that thing to user-side. Its their problem if they put undefined in nulled fields.

Previous commit was checking for more than necessary.
@pbblair
Copy link
Contributor Author

pbblair commented Nov 17, 2017

@ivanpopelyshev thanks for demonstrating where the null value was coming from. You're right, no need to check for undefined. Should be addressed in newest commit.

Previously, buttons in the DOM were in reverse order.  As a result, when braille displays showed more than one button at a time, they would also list them in reverse order.  Additionally, the initial focus within Pixi would sometimes jump straght to the initial DOM element, counter-intuitively the last button created by the game.  Both of these problems have been resolved.
@pbblair pbblair changed the title Accessibility Updates: Shift-Tab, button naming fallback and naming updates Accessibility Updates: Shift-Tab, div order, and button names Nov 17, 2017
@bigtimebuddy
Copy link
Member

@pbblair Thank you so much for this high-quality PR and sorry we haven't been more responsive. The team is spread a little thin right now trying to put a big effort into v5. @GoodBoyDigital is going to look at this when he's free. I'm for getting this in v4 since it does a better job at provide more device/browser coverage for accessibility.

@bigtimebuddy bigtimebuddy dismissed ivanpopelyshev’s stale review May 23, 2018 16:03

Comment has been addressed.

Copy link
Member

@GoodBoyDigital GoodBoyDigital left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice work @pbblair 👍

@lock
Copy link

lock bot commented May 23, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators May 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
💾 v4.x (Legacy) Legacy version 4 support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants