mirror of
https://github.com/scratchfoundation/scratch-blocks.git
synced 2025-08-28 22:10:31 -04:00
Make click-cancelling logic consistent for flyout (#724)
This commit is contained in:
parent
61ea0378a5
commit
f2711daa52
1 changed files with 4 additions and 1 deletions
|
@ -650,10 +650,13 @@ Blockly.Flyout.prototype.onMouseUp_ = function(/*e*/) {
|
|||
if (!this.workspace_.isDragging()) {
|
||||
// This was a click, not a drag. End the gesture.
|
||||
Blockly.Touch.clearTouchIdentifier();
|
||||
// A field is being edited if either the WidgetDiv or DropDownDiv is currently open.
|
||||
// If a field is being edited, don't fire any click events.
|
||||
var fieldEditing = Blockly.WidgetDiv.isVisible() || Blockly.DropDownDiv.isVisible();
|
||||
if (this.autoClose) {
|
||||
this.createBlockFunc_(Blockly.Flyout.startBlock_)(
|
||||
Blockly.Flyout.startDownEvent_);
|
||||
} else if (!Blockly.WidgetDiv.isVisible()) {
|
||||
} else if (!fieldEditing) {
|
||||
Blockly.Events.fire(
|
||||
new Blockly.Events.Ui(Blockly.Flyout.startBlock_, 'click',
|
||||
undefined, undefined));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue