-
Notifications
You must be signed in to change notification settings - Fork 14
refactor: tabs to use details/summary with ARIA roles and keyboard navigation #5674
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
base: main
Are you sure you want to change the base?
Conversation
|
Co-authored-by: mfranzke <[email protected]>
Co-authored-by: mfranzke <[email protected]>
…tructure Co-authored-by: mfranzke <[email protected]>
…isabled selectors Co-authored-by: mfranzke <[email protected]>
|
@copilot in all of your descriptions you've missed the relation in between the elements. The previously focusable interactive element ( This only seems to relate to the description in this PR, the |
You're absolutely correct - my descriptions were backwards. The actual transformation in the code is:
The implementation itself is correct, with |
|
@copilot the |
Co-authored-by: mfranzke <[email protected]>
Fixed in commit 3eda3a3. Moved |
Refactor Tabs Component to use details/summary Elements
Completed:
input[type="radio"]withdetailsandsummaryelementsnameattribute with UUID for mutual exclusivityKey Implementation Details:
ARIA Attributes on Correct Elements: Since
<details>hasrole="none", ARIA attributes likearia-disabledmust be on the<summary>element instead, which has the actualrole="tab".Mutual Exclusivity: The native
nameattribute on<details>elements provides automatic mutual exclusivity - only one details element with the same name can be open at a time.Accessibility:
tablist > tab(usingrole="none"on intermediate elements)aria-selected,aria-controls,aria-labelledbyon<summary>aria-disabledmoved to<summary>(not on<details role="none">)Breaking Changes:
HTML structure changed from radio buttons to details/summary. Custom CSS/JS targeting the old structure will need updates.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.