Skip to content

Commit

Permalink
fix: 6076 "dragging fails" improved
Browse files Browse the repository at this point in the history
  • Loading branch information
tweini committed Apr 20, 2022
1 parent 9e2d17f commit a0171b1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/block_dragger.js
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,11 @@ const BlockDragger = class {
// Moving icons moves their associated bubbles.
for (let i = 0; i < this.dragIconData_.length; i++) {
const data = this.dragIconData_[i];
data.icon.setIconLocation(Coordinate.sum(data.location, dxy));
// Don't move hidden Icons as they can have not been initialized.
// fixes #6076
if (!this.draggingBlock_.isCollapsed() || !data.icon.collapseHidden) {
data.icon.setIconLocation(Coordinate.sum(data.location, dxy));
}
}
}

Expand Down
6 changes: 6 additions & 0 deletions core/serialization/blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,12 @@ const loadIcons = function(block, state) {
setTimeout(() => blockSvg.getCommentIcon().setVisible(true), 1);
}
}
// fixes #6076 JSO deserialization doesn't
// set .iconXY_ property so here it will be set
const icons = block.getIcons();
for (let i = 0; i < icons.length; i++) {
icons[i].computeIconLocation();
}
};

/**
Expand Down

0 comments on commit a0171b1

Please sign in to comment.