Skip to content

Commit

Permalink
Update number input validator
Browse files Browse the repository at this point in the history
  • Loading branch information
artf committed Oct 26, 2017
1 parent 43c0a34 commit ed984a2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/domain_abstract/ui/InputNumber.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,9 @@ module.exports = Input.extend({
downArrowClick() {
const model = this.model;
const step = model.get('step');
let value = model.get('value');
value = this.normalizeValue(value - step);
var valid = this.validateInputValue(value);
const value = model.get('value');
const val = this.normalizeValue(value - step);
var valid = this.validateInputValue(val);
model.set('value', valid.value);
this.elementUpdated();
},
Expand Down Expand Up @@ -241,7 +241,7 @@ module.exports = Input.extend({
var force = 0;
var opt = opts || {};
var model = this.model;
var val = value || model.get('defaults');
var val = value !== '' ? value : model.get('defaults');
var units = model.get('units') || [];
var unit = model.get('unit') || (units.length && units[0]) || '';
var max = model.get('max');
Expand Down

0 comments on commit ed984a2

Please sign in to comment.