-
Notifications
You must be signed in to change notification settings - Fork 57
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
Feat add focus management for toolbar #30
Conversation
This follows best practices for toolbar focus management, following the guidelines available at https://www.w3.org/TR/wai-aria-practices-1.1/examples/toolbar/toolbar.html. ArrowLeft/ArrowRight will switch tabindex/focus the next and previous buttons respectively, cycling round the whole toolbar if needed. Home and End keys were also implemented.
Co-Authored-By: Mu-An 慕安 <me@muanchiou.com>
This allows non-MarkdownButtonElement instances to be part of the focus management cycle
This allows for non-MarkdownButtonElement members to also handle focus management keyboard shortcuts, as the event binding is per-toolbar not per-button
Co-Authored-By: Mu-An 慕安 <me@muanchiou.com>
Co-Authored-By: Mu-An 慕安 <me@muanchiou.com>
This catches an edge case where if the `md-*` buttons aren't upgraded before `markdown-toolbar` is, then `markdown-toolbar` will still behave correctly, as it can still select for the `md-*` buttons.
Now markdown-toolbar manages all tabindex assignment, which means it will also assign tabindexes to `data-md-button` elements, as needed.
Co-Authored-By: David Graham <dgraham@github.com>
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.
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.
For posterity: @keithamus and I paired this and noticed that we need a proper visibility check on the buttons for the responsive markdown toolbar items.
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! Only missing some documentation now in the README. A link to the spec and some description on how to add custom buttons in to the navigation sequence should suffice.
Found an issue.
This allows toolbars to be in an initially hidden state, and only when they are visible and focus moves to them does the focus management kick in.
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.
👍🏻 Still needs docs.
Co-Authored-By: Mu-An 慕安 <me@muanchiou.com>
Co-Authored-By: Mu-An 慕安 <me@muanchiou.com>
Co-Authored-By: Mu-An 慕安 <me@muanchiou.com>
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.
👍 !
Co-Authored-By: Mu-An 慕安 <me@muanchiou.com>
This follows best practices for toolbar focus management, following the guidelines available at https://www.w3.org/TR/wai-aria-practices-1.1/examples/toolbar/toolbar.html.
ArrowLeft/ArrowRight will switch tabindex/focus the next and previous buttons respectively, cycling round the whole toolbar if needed. Home and End keys were also implemented.
Refs https://github.com/github/github/issues/133916