-
Notifications
You must be signed in to change notification settings - Fork 560
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
Improve navigation accessibility #2707
Conversation
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.
can you share a quick synopsis of the difference that focus-trap-react
brings from react-onclickoutside
?
also, should we be removing the react-onclickoutside
dependency? if it's still in use in other modules, should they also be updated?
@dmsnell absolutely. This is still a bit of a work in progress, but I'll be sure to include information on the packages utilized. |
@dmsnell I went ahead and refactored the Revisions Selector to improve its accessibility and remove its usage of
As represented above, I chose to leverage
Edit: Updated chart to correct misrepresentation |
One additional note is that I did not address the above from #979. I believe that will likely require a larger investigation and discussion regarding to how to best organized the navigation items and their relation to the note list and note editor. I.e. how to associate navigation items with specific states for the notes list and note editor. I plan to create a separate issue for exploring this piece. |
@dcalhoun we're not talking about a big difference in code size between those libraries beyond What are your thoughts on the quality and maintainership of those libraries? Is one clearly better for accessibility? I don't have experience with either. |
f5aea83
to
80ebd75
Compare
@dmsnell great questions!
I think the two packages are fairly comparable in terms of quality. However, it is very evident that That said, after restating these thoughts out for consideration, it does seem like Relatedly, one day React may includes its own focus management. However, I do not believe that is likely to occur soon. |
thanks for providing such helpful info @dcalhoun
sounds like both are probably fine given what you said. you can pick the direction and set it 😉 I feel like I understand the context much better now though, and hopefully soon we'll be able to get rid of the this is great work you've been providing. I'm sure it's helping out in some of the worst usability areas with our app |
e878a30
to
276b846
Compare
After considering the available options again, I have chosen to continue using
Plan to move forward with |
276b846
to
65607aa
Compare
{showRevisions ? ( | ||
<NotePreview noteId={openedNote} note={openedRevision} /> | ||
<NotePreview | ||
aria-hidden={hiddenByRevisions} |
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.
why use aria-hidden
as opposed to ariaHidden
?
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.
Largely for consistency between DOM elements and React elements (i.e. use kebab-case in both instances).
That said, I don't have a strong opinion. Happy to change the key for React elements to be camelcase. Would you like me to do that?
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.
@codebykat @sandymcfadden Any thoughts? I don't feel super strongly about it.
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.
I think the kebab-case is fine, I don't have strong feelings either.
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 might be good to have someone else look over as well, but from my look and testing it all seems to be working well as expected.
Love the accessibility improvements!
65607aa
to
0dec0e1
Compare
While the navigation sidebar is open, focus will be trapped to the sidebar. This improves keyboard and screen reader navigation by preventing focus from jumping to UI outside of the sidebar. The focus-trap-react package was added to accomplish this because its quality and ease-of-use. Hide unrelated content while navigation is open Prevent screen readers from reading content outside of the navigation while the navigation is open. Reorder navigation elements to improve focus navigation The previous ordering resulted in illogical focus navigation. This change ensures that the navigation elements still render visually in the same order as before, but now the stepping through the elements via keyboard or screen reader focus matches the visual ordering. Fix return focus when dismissing About dialog Previously, dismissing the About dialog would result in the first focusable element within the navigation to be focused, instead of the About link. Leveraging the `paused` property is more appropriate for our use case and fixes this issue. Adjust navigation styles to improve active focus indication Refactor styles so that is more apparent when an element is focused. Match latest develop styles Improve accessibility of revisions selector Add focus trap and aria-hidden qualities when the revisions selector is open to improve the navigation experience for keyboards and screen readers. Consolidate aria-hidden management to app layout Attempt to avoid spreading aria-hidden status across multiple components. Hopefully placing it in one location, app layout, will allow easier management in the future. Add dialog role to Revision Selector Improve accessibility for screen reader navigation by grouping Revision Selector as a dialog. Improve accessibility of note History dialog Describe the dialog and the current revision selected. Remove unused import
0dec0e1
to
de04d19
Compare
Fix
Fixes #979 and fixes #980. Improve navigation accessibility via the following:
VoiceOver Interaction: Navigation
voiceover-interaction.mov
VoiceOver Interaction: Revisions Selector
Screen.Recording.2021-03-03.at.08.27.23.mov
Test
Scenario 1
corner of the screen.
Expected Outcome:
trap, and returns focus to the "Menu" button.
trap, and returns focus to the "Menu" button.
Scenario 2
corner of the screen.
list.
Expected Outcome:
Scenario 3
corner of the screen.
Expected Outcome:
trap, and returns focus to the note editor.
trap, and returns focus to the note editor.
Release
RELEASE-NOTES.md
was updated with: