-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
DOM: fix findNext/Previous tabbable if target is not in findFocusable list #46580
Conversation
Size Change: -23 B (0%) Total Size: 1.32 MB
ℹ️ View Unchanged
|
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.
That's a great fix Ella, thanks!
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.
Clever. :)
Just seeing this, thank you for working on this fix! TIL |
What?
The problem is that, when focus is on a scrollable container,
focus.tabbable.findNext
fails because the scroll container is not in thefindFocusable
list.indexOf
returns-1
, so we fail to slice the list correctly.The solution is to use
compareDocumentPosition
to find the previous/next element in the list.Why?
Fixes #45489.
How?
Testing Instructions
Open the inserter in Firefox and try to tab to the list of blocks.
Testing Instructions for Keyboard
Screenshots or screencast