Skip to content

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
Contributor

This no longer applies because #6758 was reverted

@BeksOmega
Copy link
Contributor

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

@BeksOmega BeksOmega requested review from BeksOmega and removed request for NeilFraser August 21, 2023 21:55
@BeksOmega BeksOmega assigned BeksOmega and unassigned NeilFraser Aug 21, 2023
Comment on lines +331 to +335
const draggingBlock = this.workspace
.getCanvas()
.querySelector('.blocklyDragging');
if (draggingBlock) {
this.workspace.getCanvas().insertBefore(svgRoot, draggingBlock);
Copy link
Contributor

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 RaspberryPiFoundation:develop Aug 21, 2023
@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