Repository navigation
Add tabIndex reflection and the Focusable mixin - #120
Merged
Merged
Conversation
commit: |
cowboyd
marked this pull request as ready for review
December 1, 2026 19:16
cowboyd
force-pushed
the
dom-tabindex
branch
2 times, most recently
from
December 2, 2026 17:26
49b619a to
fe9bc98
Compare
cowboyd
marked this pull request as draft
December 2, 2026 22:22
cowboyd
force-pushed
the
dom-tabindex
branch
2 times, most recently
from
December 3, 2026 19:59
d7ee88f to
3fe27ee
Compare
cowboyd
marked this pull request as ready for review
December 3, 2026 20:00
natemoo-re
approved these changes
Dec 5, 2026
natemoo-re
left a comment
Member
There was a problem hiding this comment.
Nice! The mixin pattern is lovely 🫶
| @@ -0,0 +1,51 @@ | |||
| /* oxlint-disable bombshell-dev/exported-function-async -- Mixin factories return classes synchronously. */ | |||
Member
There was a problem hiding this comment.
At this point, we can probably move everything standard-shaped under a src/dom/* directory and turn this rule off in the config.
| export function parseTabIndex(attribute: string | null): number | null { | ||
| const match = attribute?.match(/^[\t\n\f\r ]*([+-]?[0-9]+)/); | ||
| const value = match ? Number(match[1]) : NaN; | ||
| return value >= -2147483648 && value <= 2147483647 ? value || 0 : null; |
Member
There was a problem hiding this comment.
can we extract 2147483648 to a named const to avoid the magic number?
6 of 12 tasks
dreyfus92
approved these changes
Dec 5, 2026
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.
What does this PR do?
Reflects tabIndex and gives buttons their default focusability through a shared Focusable mixin, backed by mixin() and createMixin().
Type of change
Checklist
pnpm test)pnpm format)AI-generated code disclosure