From 863a4a52d9f0d4f6b828302a24f3deeb0f41f241 Mon Sep 17 00:00:00 2001 From: Sam El-Husseini Date: Wed, 9 Oct 2019 11:16:16 -0700 Subject: [PATCH] Revert calling onHide before the animation is complete to avoid double click issues. (#3202) --- core/dropdowndiv.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/core/dropdowndiv.js b/core/dropdowndiv.js index 5132b99a4..cb403bcbd 100644 --- a/core/dropdowndiv.js +++ b/core/dropdowndiv.js @@ -263,7 +263,7 @@ Blockly.DropDownDiv.showPositionedByBlock = function(field, block, */ Blockly.DropDownDiv.showPositionedByField = function(field, opt_onHide, opt_secondaryYOffset) { - var position = field.fieldGroup_.getBoundingClientRect(); + var position = field.getSvgRoot().getBoundingClientRect(); // If we can fit it, render below the block. var primaryX = position.left + position.width / 2; var primaryY = position.bottom; @@ -574,11 +574,11 @@ Blockly.DropDownDiv.hide = function() { Blockly.DropDownDiv.animateOutTimer_ = setTimeout(function() { Blockly.DropDownDiv.hideWithoutAnimation(); - if (Blockly.DropDownDiv.onHide_) { - Blockly.DropDownDiv.onHide_(); - Blockly.DropDownDiv.onHide_ = null; - } }, Blockly.DropDownDiv.ANIMATION_TIME * 1000); + if (Blockly.DropDownDiv.onHide_) { + Blockly.DropDownDiv.onHide_(); + Blockly.DropDownDiv.onHide_ = null; + } }; /**