8000 Dragging blocks stops their selection highlight · Issue #9027 · google/blockly · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Dragging blocks stops their selection highlight #9027

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

Closed
1 task done
BenHenning opened this issue May 12, 2025 · 3 comments · Fixed by #9034
Closed
1 task done

Dragging blocks stops their selection highlight #9027

BenHenning opened this issue May 12, 2025 · 3 comments · Fixed by #9034
Assignees
Labels
injection issue: bug Describes why the code or behaviour is wrong

Comments

@BenHenning
Copy link
Contributor

Check for duplicates

  • I have searched for similar issues before opening a new one.

Description

Attempting to drag a block results in the block's selection highlight disappearing until dragging finishes (at which point it's restored).

Reproduction steps

  1. Open the playground for v12.
  2. Insert any block.
  3. Click to drag the block around.
  4. Observe that selection highlight is missing during dragging.

Stack trace

Screenshots

No response

Browsers

No response

@BenHenning BenHenning added issue: bug Describes why the code or behaviour is wrong issue: triage Issues awaiting triage by a Blockly team member labels May 12, 2025
@BenHenning
Copy link
Contributor Author

This is almost certainly caused by focus being lost during drag and the auto-selection mechanism in BlockSvg resulting in selection being dropped.

I'm uncertain why focus is lost--that requires more digging.

@BenHenning
Copy link
Contributor Author

NB: This is also broken for workspace comments (and technically bubbles, though they don't have an actual highlight to show).

BenHenning added a commit that referenced this issue May 13, 2025
## The basics

- [x] I [validated my changes](https://developers.google.com/blockly/guides/contribute/core#making_and_verifying_a_change)

## The details
### Resolves

Fixes #9027

### Proposed Changes

Ensure that a block being dragged is properly focused mid-drag.

### Reason for Changes

Focus seems to be lost due to the block being moved to the drag layer, so re-focusing the block ensures that it remains both actively focused and selected while dragging.

The regression was likely caused when block selection was moved to be fully synced based on active focus.

### Test Coverage

This has been manually verified in Core's simple playground. At the time of the PR being opened, this couldn't be tested in the test environment for the experimental keyboard navigation plugin since there's a navigation connection issue there that needs to be resolved to test movement.

It would be helpful to add a new test case for the underlying problem (i.e. ensuring that the block holds focus mid-drag) as part of resolving #8915.

### Documentation

No new documentation should need to be added.

### Additional Information

This was found during the development of google/blockly-keyboard-experimentation#511.
@BenHenning
Copy link
Contributor Author

Fixed in #9034.

@github-project-automation github-project-automation bot moved this from In Progress to Done in Blockly Accessibility May 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
injection issue: bug Describes why the code or behaviour is wrong
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants
0