-
Notifications
You must be signed in to change notification settings - Fork 6
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
Issue/accessibility #56
Conversation
…m tabbing/screenreader as appropriate
… selecting in older Firefox, adds aria-labels
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.
Some high-level design considerations:
- The keyboard controls should be provided in a dedicated dialog accessed via a visible button on the player, instead of being dictated when the start button is focused again. I'd only know to what hotkey to press to re-read the instructions if I happen read through them the first time, and the controls are not conveyed to sighted users at all.
- We discussed this for other widgets in other contexts, but focusing the question text when a question is first displayed is probably suitable here. It serves as an easy way to convey critical game info (the current question) as well as a suitable programmatic focus target when we advance to the next question. Pressing "Q" could focus this element or simply read its contents. There should be a visible style associated with focusing the question, but not one that could be confused with an actual selectable input.
- Selecting an answer choice should provide an
assertive
aria-live region update to dictate the results of the selection (correct or incorrect) as well as reading back the feedback, if present. Answer choices should remain focusable after an answer is formally selected, and provide game state ("question answered, correct or incorrect"), and read feedback, if present, when focused. - Selecting the next question button should probably indicate how many questions remain.
New changes:
|
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.
- 👍 keyboard controls button and modal is good
- I would use a more readable sans-serif text for the body of the keyboard instructions modal, the font used for buttons and headings is fine for large text but really difficult to read in paragraphs.
- I like the animation associated with the question number UI element but I think it's overly complicated for what it needs. Ideally, the question itself is focusable and the question number is either appended or prepended to the text when read aloud. As a potential alternative, the question number could be conveyed via live region when you transition to the next question. You could then have a static, non-interactive text version of the "X of Y" question number visually displayed somewhere (if you want more feedback or ideas about this, just lemme know.)
esc
is a default navigation keybinding, so I would avoid using it for toggling the keyboard instructions dialog. "H" is probably a better option and is used in other widgets.- The "Next" button appears to be encapsulated in another element that's also tabbable, so the first element identified by the screenreader is the generic "group" element followed by tabbing into the button itself. That should be condensed down to just the button.
- There appears to be a tab trap where the user cannot paginate forward out of the answer pairs to the rest of the page. Instead of looping users back around, maybe assign left and right arrow keys to focus the This and That options. Users should always be able to tab out of the widget in both directions.
Good catches! I've changed the question number to have a status role and changed its aria-label to say " questions remaining. On question of : [question title]". Player can press "Q" to read out the question again with its number. They can also use standard navigation to navigate to the question title, which is only a couple presses away. When the player hits Next, the aria-live region reads out "Question <> of <>: [question title]". |
I'd also try and resolve the tests not passing, if possible. |
You got it 👍🏻 Also, I pushed a few more changes, which inevitably broke some things on Chrome (such as the aria-live update not playing on the first question, and the "1 questions remaining" playing after all questions are finished). I'll look into getting these fixed asap. Edit: Aria-live region updates can now be heard in both browsers. However, returning focus to the last selected element after exiting keyboard controls is broken in Chrome. |
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.
No show-stoppers remaining. Well done.
Fixes accessibility issues in the player.
Problem: The 'Start' button is reachable in the tab order even after a play has startedProblem: Content outside of lightbox is navigableProblem: Clicking "Start" and "Next" and exiting lightbox seems to make the application lose focus.element.focus()
doesn't appear to work). After choosing this or that, it should direct focus to the Next button. After clicking Next, an invisible, tabbablediv
will redirect focus to the start of the application.Problem: Game status updates are not being read outProblem: Entire game board shifts upward when VoiceOver is usedAdditional changes
Notes
Tab navigation will not work with Firefox versions < 112 (released April 11, 2023) because of the use of the
inert
attribute.To-Do
Jest test coverage