From 344ebcfd02b3e405e5f87294b319f08bbf83fe15 Mon Sep 17 00:00:00 2001 From: Neil Fraser Date: Tue, 29 Jun 2021 11:30:58 -0700 Subject: [PATCH] Revert "Group field edits together for undo/redo" This reverts commit 33ad2448b82291e0b3198898d765e28118f9ced2. --- core/block_drag_surface.js | 2 +- core/field_textinput.js | 11 +++++++---- core/toolbox/category.js | 2 +- core/utils/dom.js | 2 +- core/workspace_drag_surface_svg.js | 2 +- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/core/block_drag_surface.js b/core/block_drag_surface.js index b2a2cda0f..5e2e121c7 100644 --- a/core/block_drag_surface.js +++ b/core/block_drag_surface.js @@ -159,7 +159,7 @@ Blockly.BlockDragSurfaceSvg.prototype.translateSurfaceInternal_ = function() { this.SVG_.style.display = 'block'; Blockly.utils.dom.setCssTransform( - this.SVG_, 'translate3d(' + x + 'px, ' + y + 'px, 0)'); + this.SVG_, 'translate3d(' + x + 'px, ' + y + 'px, 0px)'); }; /** diff --git a/core/field_textinput.js b/core/field_textinput.js index 7e5f1d205..9b389c5a8 100644 --- a/core/field_textinput.js +++ b/core/field_textinput.js @@ -340,7 +340,6 @@ Blockly.FieldTextInput.prototype.showInlineEditor_ = function(quietInput) { * @protected */ Blockly.FieldTextInput.prototype.widgetCreate_ = function() { - Blockly.Events.setGroup(true); var div = Blockly.WidgetDiv.DIV; Blockly.utils.dom.addClass(this.getClickTarget_(), 'editing'); @@ -369,8 +368,8 @@ Blockly.FieldTextInput.prototype.widgetCreate_ = function() { div.style.borderRadius = borderRadius; div.style.transition = 'box-shadow 0.25s ease 0s'; if (this.getConstants().FIELD_TEXTINPUT_BOX_SHADOW) { - div.style.boxShadow = 'rgba(255, 255, 255, 0.3) 0 0 0 ' + - (4 * scale) + 'px'; + div.style.boxShadow = 'rgba(255, 255, 255, 0.3) 0px 0px 0px ' + + 4 * scale + 'px'; } } htmlInput.style.borderRadius = borderRadius; @@ -403,7 +402,6 @@ Blockly.FieldTextInput.prototype.widgetDispose_ = function() { if (this.onFinishEditing_) { this.onFinishEditing_(this.value_); } - Blockly.Events.setGroup(false); // Actual disposal. this.unbindInputEvents_(); @@ -479,10 +477,15 @@ Blockly.FieldTextInput.prototype.onHtmlInputChange_ = function(_e) { if (text !== this.htmlInput_.oldValue_) { this.htmlInput_.oldValue_ = text; + // TODO(#2169): Once issue is fixed the setGroup functionality could be + // moved up to the Field setValue method. This would create a + // broader fix for all field types. + Blockly.Events.setGroup(true); var value = this.getValueFromEditorText_(text); this.setValue(value); this.forceRerender(); this.resizeEditor_(); + Blockly.Events.setGroup(false); } }; diff --git a/core/toolbox/category.js b/core/toolbox/category.js index ae9755cad..daab5832b 100644 --- a/core/toolbox/category.js +++ b/core/toolbox/category.js @@ -652,7 +652,7 @@ Blockly.Css.register([ '.blocklyToolboxDiv[dir="RTL"] .blocklyTreeRow {', 'margin-left: 8px;', - 'padding-right: 0', + 'padding-right: 0px', '}', '.blocklyTreeIcon {', diff --git a/core/utils/dom.js b/core/utils/dom.js index 57843c8b9..392f0094d 100644 --- a/core/utils/dom.js +++ b/core/utils/dom.js @@ -370,7 +370,7 @@ Blockly.utils.dom.measureFontMetrics = function(text, fontSize, fontWeight, var block = document.createElement('div'); block.style.width = '1px'; - block.style.height = 0; + block.style.height = '0px'; var div = document.createElement('div'); div.setAttribute('style', 'position: fixed; top: 0; left: 0; display: flex;'); diff --git a/core/workspace_drag_surface_svg.js b/core/workspace_drag_surface_svg.js index cef1f7921..0b5032ebd 100644 --- a/core/workspace_drag_surface_svg.js +++ b/core/workspace_drag_surface_svg.js @@ -94,7 +94,7 @@ Blockly.WorkspaceDragSurfaceSvg.prototype.translateSurface = function(x, y) { this.SVG_.style.display = 'block'; Blockly.utils.dom.setCssTransform( - this.SVG_, 'translate3d(' + fixedX + 'px, ' + fixedY + 'px, 0)'); + this.SVG_, 'translate3d(' + fixedX + 'px, ' + fixedY + 'px, 0px)'); }; /**