Skip to content
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

fix: Always draw dragged blocks atop others in the workspace. #6874

Merged
merged 2 commits into from
Aug 21, 2023

Conversation

gonfunko
Copy link
Contributor

@gonfunko gonfunko commented Mar 1, 2023

The basics

  • I branched from develop
  • My pull request is against develop
  • My code follows the style guide
  • I ran npm run format and npm run lint

The details

Resolves

Fixes #6852

Proposed Changes

When blocks are dragged, bring them to the front, and update setParent to insert blocks before the block being dragged, if any, when removing it from its parent.

Behavior Before Change

Blocks would occassionally appear behind other blocks when being dragged.

Behavior After Change

Blocks being dragged appear atop all other blocks.

Reason for Changes

Fixes a regression introduced in #6758.

@BeksOmega
Copy link
Collaborator

This no longer applies because #6758 was reverted

@BeksOmega
Copy link
Collaborator

#6758 was rerolled as #7070 so we need to merge this now as well.

Comment on lines +331 to +335
const draggingBlock = this.workspace
.getCanvas()
.querySelector('.blocklyDragging');
if (draggingBlock) {
this.workspace.getCanvas().insertBefore(svgRoot, draggingBlock);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gonfunko do you remember what case this was handling?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not offhand :/ Judging by the comment maybe it's when a block is disconnected from a stack?

@BeksOmega BeksOmega merged commit 9909868 into google:develop Aug 21, 2023
8 checks passed
@gonfunko gonfunko deleted the dragz branch August 21, 2023 22:21
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.

Dragged blocks appear behind blocks in the workspace
3 participants