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(tabs): make tab panels focusable #2281

Merged
merged 1 commit into from
May 22, 2024
Merged

Conversation

gerjanvangeest
Copy link
Member

What I did

Copy link

changeset-bot bot commented May 14, 2024

🦋 Changeset detected

Latest commit: d493f6c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@lion/ui Patch

Not sure what this means? Click here to learn what changesets are.

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

* https://www.w3.org/WAI/ARIA/apg/patterns/tabs/examples/tabs-automatic/
*/
if (!el.hasAttribute('tabindex')) {
el.setAttribute('tabindex', '0');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we can also clean up on cleanButton?
(where it's usually better to restore initial state (could be stored in a Weakmap) then a regardless removal)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cleanButton() function makes sure the button and panels are "clean" before we put our own id, role and event listeners on it.
It is not a restore afterwards.

Copy link
Member

@tlouisse tlouisse May 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's called here on slot change:

Basically we say here: "whatever content is now available in the slot (it might be different from the contents that were previously inside the slot that we already altered), make sure that we leave the elements we altered in a clean state (their initial state)"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created an issue for doing this consistently throughout the codebase: #2295

@gerjanvangeest gerjanvangeest merged commit 08a1cb1 into master May 22, 2024
5 checks passed
@gerjanvangeest gerjanvangeest deleted the fix/panel-tabindex branch May 22, 2024 07:24
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.

None yet

2 participants