RocketCommunicationsInc / astro

Astro UXDS is a collection of guidelines, patterns and components for designing space-based user interface applications.
https://astrouxds.com
Other
115 stars 25 forks source link

Fix keyboard functionality for rux-tabs #972

Closed kiley-mitti closed 1 year ago

kiley-mitti commented 1 year ago

Brief Description

Borrowed some code from Mark for the keyboard functionality of tabs, and then inserted my own roving tab index logic. Now tabs work as they should. They currently do not automatically activate on focus but a keyboard user can use the arrow keys to select the appropriate tab and hit enter to activate it.

JIRA Link

ASTRO-4952

Related Issue

Part of focus state work.

General Notes

Motivation and Context

tab keyboard control didn't work as one would expect. now it does.

Issues and Limitations

I am sick. please look at code and critique my potato brain.

Types of changes

Checklist

changeset-bot[bot] commented 1 year ago

⚠️ No Changeset found

Latest commit: 16eb447972538c88005814da4ef55bcc85a7d37c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

kiley-mitti commented 1 year ago

Added some tests to cover the keyboard functionality changes! @markacianfrani do these look ok? They're all passing. :)

kiley-mitti commented 1 year ago

I also made a change to where role="tab" lives. We can't put it directly on because it is tied to focus so needs to be where tabindex lives.

kiley-mitti commented 1 year ago

Added a new test for disabled tabs! One more look? :)