mirror of
https://github.com/google/blockly.git
synced 2026-01-06 16:40:07 +01:00
Merge pull request #27 from BrianGeppert/bugfix/prompt-cancel
Don't crash on prompt cancel.
This commit is contained in:
@@ -253,6 +253,9 @@ Blockly.FieldTextInput.prototype.widgetDispose_ = function() {
|
||||
* @return {?string} A string representing a valid number, or null if invalid.
|
||||
*/
|
||||
Blockly.FieldTextInput.numberValidator = function(text) {
|
||||
if(text === null) {
|
||||
return null;
|
||||
}
|
||||
// TODO: Handle cases like 'ten', '1.203,14', etc.
|
||||
// 'O' is sometimes mistaken for '0' by inexperienced users.
|
||||
text = text.replace(/O/ig, '0');
|
||||
|
||||
Reference in New Issue
Block a user