fix: Don't select shadow blocks on click#9538
Merged
Conversation
Collaborator
Please add automated tests for these cases. |
BenHenning
reviewed
Dec 22, 2025
Contributor
Author
|
Added a test to verify that clicked shadow blocks don't become selected. Ready for another look @BenHenning |
BenHenning
approved these changes
Jan 13, 2026
Collaborator
BenHenning
left a comment
There was a problem hiding this comment.
Thanks for adding the new test, this LGTM!
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 #9180
Proposed Changes
This PR fixes a bug that could cause shadow blocks to temporarily or permanently become selected when clicked on. Clicking on a block triggers a block start gesture, which correctly handles shadow blocks when determining what to select (their parent block). Click events bubble up to the workspace and trigger a workspace start gesture as well though, and that was focusing the start block, which is sometimes different than the target block that the block gesture start handler resolves. I updated the check for "nothing else should be focused" to check
targetBlockrather thanstartBlock, and removed the explicit call focus the target/start block, since that would have already happened in the block start gesture handler.I verified that shadow blocks still become selected via keyboard navigation, that clicking a shadow block focuses its parent block, that workspace comments and bubbles are still selectable, and that clicking the workspace focuses the workspace.