diff --git a/accessible/field-segment.component.js b/accessible/field-segment.component.js index 0f3ee6c58..4f2852a4e 100644 --- a/accessible/field-segment.component.js +++ b/accessible/field-segment.component.js @@ -156,6 +156,11 @@ blocklyApp.FieldSegmentComponent = ng.core.Component({ }, // Confirm a selection for dropdown fields. selectOption: function() { + if (this.optionValue != Blockly.Msg.RENAME_VARIABLE && this.optionValue != + Blockly.Msg.DELETE_VARIABLE.replace('%1', this.mainField.getValue())) { + this.mainField.setValue(this.optionValue); + } + if (this.optionValue == Blockly.Msg.RENAME_VARIABLE) { this.variableModalService.showRenameModal_(this.mainField.getValue()); } @@ -172,11 +177,6 @@ blocklyApp.FieldSegmentComponent = ng.core.Component({ return; } - if (this.optionValue != Blockly.Msg.RENAME_VARIABLE && this.optionValue != - Blockly.Msg.DELETE_VARIABLE.replace('%1', this.mainField.getValue())) { - this.mainField.setValue(this.optionValue); - } - var optionText = undefined; for (var i = 0; i < this.dropdownOptions.length; i++) { if (this.dropdownOptions[i].value == optionValue) { diff --git a/accessible/variable-add-modal.component.js b/accessible/variable-add-modal.component.js index 2220ce9ea..e113b49fb 100644 --- a/accessible/variable-add-modal.component.js +++ b/accessible/variable-add-modal.component.js @@ -43,6 +43,8 @@ blocklyApp.VariableAddModalComponent = ng.core.Component({