Skip to content

Commit

Permalink
Fix bug with updating cursor style in draggers
Browse files Browse the repository at this point in the history
  • Loading branch information
kozbial committed Jun 10, 2021
1 parent d2c61d5 commit 2dc2143
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions core/block_dragger.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,12 +217,12 @@ Blockly.BlockDragger.prototype.dragBlock = function(e, currentDragDeltaXY) {
}

this.draggedConnectionManager_.update(delta, this.dragTarget_);
var wouldDeleteBlock = this.draggedConnectionManager_.wouldDeleteBlock();
if (wouldDeleteBlock != this.wouldDeleteBlock_) {
var oldWouldDeleteBlock = this.wouldDeleteBlock_;
this.wouldDeleteBlock_ = this.draggedConnectionManager_.wouldDeleteBlock();
if (oldWouldDeleteBlock != this.wouldDeleteBlock_) {
// Prevent unnecessary add/remove class calls.
this.updateCursorDuringBlockDrag_();
}
this.wouldDeleteBlock_ = wouldDeleteBlock;
};

/**
Expand Down
6 changes: 3 additions & 3 deletions core/bubble_dragger.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,12 @@ Blockly.BubbleDragger.prototype.dragBubble = function(e, currentDragDeltaXY) {
this.dragTarget_ && this.dragTarget_.onDragEnter();
}

var wouldDeleteBubble = this.shouldDelete_(this.dragTarget_);
if (wouldDeleteBubble != this.wouldDeleteBubble_) {
var oldWouldDeleteBubble = this.wouldDeleteBubble_;
this.wouldDeleteBubble_ = this.shouldDelete_(this.dragTarget_);
if (oldWouldDeleteBubble != this.wouldDeleteBubble_) {
// Prevent unnecessary add/remove class calls.
this.updateCursorDuringBubbleDrag_();
}
this.wouldDeleteBubble_ = wouldDeleteBubble;
};

/**
Expand Down

0 comments on commit 2dc2143

Please sign in to comment.