-
Notifications
You must be signed in to change notification settings - Fork 299
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
Conversation
🦋 Changeset detectedLatest commit: d493f6c The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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'); |
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.
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)
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.
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.
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 it's called here on slot change:
this.__cleanStore(); |
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)"
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.
Created an issue for doing this consistently throughout the codebase: #2295
What I did