Skip to content

Commit 3b234c7

Browse files
authored
fix: Call onFinishEditing_ for fields on mobile. (#7483)
On the desktop, widgetDispose_ will call onFinishEditing_ on close. This was missing in the mobile counterpart, so any cleanups in onFinishEditing_ would not be called. Also update the message string comment while we are touching this code.
1 parent ed043e7 commit 3b234c7

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

core/field_input.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,7 @@ export abstract class FieldInput<T extends InputTypes> extends Field<
342342
if (text !== null) {
343343
this.setValue(this.getValueFromEditorText_(text));
344344
}
345+
this.onFinishEditing_(this.value_);
345346
},
346347
);
347348
}

msg/messages.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ Blockly.Msg.REDO = 'Redo';
132132

133133
// Variable renaming.
134134
/** @type {string} */
135-
/// prompt - This message is only seen in the Opera browser. With most browsers, users can edit numeric values in blocks by just clicking and typing. Opera does not allows this, so we have to open a new window and prompt users with this message to chanage a value.
135+
/// prompt - This message is seen on mobile devices and the Opera browser. With most browsers, users can edit numeric values in blocks by just clicking and typing. Opera does not allow this and mobile browsers may have issues with in-line textareas. So we prompt users with this message (usually a popup) to change a value.
136136
Blockly.Msg.CHANGE_VALUE_TITLE = 'Change value:';
137137
/** @type {string} */
138138
/// dropdown choice - When the user clicks on a variable block, this is one of the dropdown menu choices. It is used to rename the current variable. See [https://github.com/google/blockly/wiki/Variables#dropdown-menu https://github.com/google/blockly/wiki/Variables#dropdown-menu].

0 commit comments

Comments
 (0)