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

fix: make TabButton aria compliant as a button #417

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

paralin
Copy link
Contributor

@paralin paralin commented Oct 23, 2023

Allows using the keyboard to select tabs by pressing the Tab key to switch between elements on the page, and then pressing "enter" or space " " to select the highlighted tab.

Allows using the keyboard to select tabs by pressing the Tab key to switch
between elements on the page, and then pressing "enter" or space " " to select
the highlighted tab.

Signed-off-by: Christian Stewart <christian@aperture.us>
Make the close button on TabButton a button instead of a div. It looks identical
and is aria compliant as a button, supporting screen readers and keyboard
navigation with tab to select and enter or space to click. Note that a event
handler for onCloseKeyDown was added to stop event propagation when pressing
enter or space, so that the button's normal onClick logic is called, and the
keyboard event does not propagate to the TabButton keyboard event handler.

Allows using the keyboard to select the tab close button by pressing the Tab key
to switch between elements on the page, and then pressing "enter" or space " "
to select the highlighted button.

Signed-off-by: Christian Stewart <christian@aperture.us>
@paralin
Copy link
Contributor Author

paralin commented Nov 3, 2023

@nealus Fixed aria-compliance for TabButton and the close button on TabButton.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant