fix: drop IFocusableNode from trash and zoom - #10272
Open
mikeharv wants to merge 2 commits into
Open
Conversation
lizschwab
approved these changes
Aug 15, 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.
The basics
The details
Resolves
Fixes #9792
Proposed Changes
IFocusableNodes. They stay ordinarytabindex="0"buttons.FocusableTreeTraverser.findFocusableNodeForno longer walks from an unregistered tab stop (tabindex >= 0) up to an ancestor node. FocusManager therefore does not steal DOM focus from those controls back to the workspace.:focus-visibleinstead ofblocklyActiveFocus.Reason for Changes
Trash and zoom lived inside the workspace's focusable DOM (
svgGroup_) and were also extra tab stops. That made them feel like both separate tab stops and part of the workspace. Tab skipped the workspace if a workspace control had previously been focused, and arrow keys jumped focus from the controls onto blocks.Dropping
IFocusableNodealone is not enough, because the traverser still mapped those elements to the workspace. This would make focusing the elements impossible. Skipping tab stops when traversing parents lets the trash and zoom buttons keep native focus without being Blockly focus nodes.Test Coverage
tabindexvalues of 0 and -1Additional Information
An alternative was considered where the trash and zoom controls remained focusable node but became their own trees. That work was explored here: