mirror of
https://github.com/google/blockly.git
synced 2026-03-09 14:50:09 +01:00
Fix validation on number field.
This commit is contained in:
@@ -31,7 +31,7 @@ goog.require('goog.math');
|
||||
|
||||
/**
|
||||
* Class for an editable number field.
|
||||
* @param {string} value The initial content of the field.
|
||||
* @param {number|string} value The initial content of the field.
|
||||
* @param {number|string|undefined} opt_min Minimum value.
|
||||
* @param {number|string|undefined} opt_max Maximum value.
|
||||
* @param {number|string|undefined} opt_precision Precision for value.
|
||||
@@ -68,7 +68,7 @@ Blockly.FieldNumber.prototype.setConstraints = function(min, max, precision) {
|
||||
this.min_ = isNaN(min) ? -Infinity : min;
|
||||
max = parseFloat(max);
|
||||
this.max_ = isNaN(max) ? Infinity : max;
|
||||
this.setValue(this.callValidator(this.getValue));
|
||||
this.setValue(this.callValidator(this.getValue()));
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user