Fix validation on number field.

This commit is contained in:
Neil Fraser
2016-07-15 20:05:45 -07:00
parent 5852f8e7e1
commit 8c48436c8f

View File

@@ -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()));
};
/**