Skip to content

fix: Fix a bug that could cause unexpected block movement when inserting blocks from the toolbox - #10289

Merged
gonfunko merged 1 commit into
mainfrom
working-on-my-block-moves
Aug 19, 2026
Merged

fix: Fix a bug that could cause unexpected block movement when inserting blocks from the toolbox#10289
gonfunko merged 1 commit into
mainfrom
working-on-my-block-moves

Conversation

@gonfunko

Copy link
Copy Markdown
Contributor

The basics

The details

Resolves

Fixes #10183

Proposed Changes

This PR fixes a bug that caused blocks on the workspace to be bumped when inserting a new block from the flyout via the keyboard. When the newly-inserted block was rendered, it called bumpNeighbors(), which is normally suppressed when a drag is in progress. However, the workspace reported drag status based on the keyboard mover, and it reported its status based on having a draggable. The draggable wasn't actually set until after onDragStart(), so at the point the block was rendered and tried to bump neighbours it appeared that a drag was not in progress, thus allowing the bump to proceed and scooch blocks that should have remained stationary out of the way. Now, the KeyboardMover tracks its dragging/moving state with an instance variable explicitly for that, rather than relying on the presence of a draggable, which resolves the timing issue.

Reason for Changes

Blocks shouldn't move by themselves.

@gonfunko
gonfunko requested a review from a team as a code owner August 19, 2026 16:10
@gonfunko
gonfunko requested a review from lizschwab August 19, 2026 16:10
@github-actions github-actions Bot added the PR: fix Fixes a bug label Aug 19, 2026
@gonfunko
gonfunko merged commit 966d29b into main Aug 19, 2026
11 of 12 checks passed
@gonfunko
gonfunko deleted the working-on-my-block-moves branch August 19, 2026 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: fix Fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unexpected movement when inserting blocks from toolbox (keyboard)

2 participants