From 77dddca02e7813e98b0c20a0404bbf2a19b2c55d Mon Sep 17 00:00:00 2001 From: Monica Kozbial <6621618+moniika@users.noreply.github.com> Date: Thu, 10 Jun 2021 10:57:09 -0700 Subject: [PATCH] Fix bug with updating cursor style in draggers (#4889) --- core/block_dragger.js | 6 +++--- core/bubble_dragger.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core/block_dragger.js b/core/block_dragger.js index 8dfac6542..b9ce831be 100644 --- a/core/block_dragger.js +++ b/core/block_dragger.js @@ -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; }; /** diff --git a/core/bubble_dragger.js b/core/bubble_dragger.js index 734445622..fd4b67b00 100644 --- a/core/bubble_dragger.js +++ b/core/bubble_dragger.js @@ -142,12 +142,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; }; /**