fix(keyboard): nested closed <details> and hidden controls (0.15.1) - #20
Merged
Merged
Conversation
isStructurallyHidden checked only the nearest closed <details>, so the summary of a <details> nested in a closed one counted as a tab stop and tab-order-mismatch fired on collapsed docs sidebars (10x on docs.ngbracket.com/components/rich-text). Every closed <details> up the tree now counts. unreachable-control also skips hidden/inert controls (new isHidden helper). Unit + real-Chromium E2E tests, both fail on the old code. Live docs rescan: 0 findings, light and dark. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
tab-order-mismatch false positive on collapsed sidebars.
isStructurallyHiddenchecked only the nearest closed<details>, so the<summary>of a<details>nested inside a closed one counted as a tab stop, although it's hidden and Tab can't reach it. The next section's summary then looked like a jump back up the page: 10 findings on docs.ngbracket.com/components/rich-text. Every closed<details>up the tree now counts (also fixes the overlay's tab-order badges).unreachable-control skips hidden controls. A custom control inside a closed
<details>,[hidden]/inert, ordisplay: nonewas reported as unreachable. NewisHiddenhelper; it's checked once shown.Tests: unit tests for flat + nested
<details>and hidden controls, plus a real-Chromium E2E page (/sidebar). Both fail on the old code. 263 pass. Live docs rescan (3 routes, light + dark): 0 findings.Logged separately (not in this PR): roving-tabindex items (
role="tab" tabindex="-1") are flagged as unreachable.🤖 Generated with Claude Code