Skip to content

Commit

Permalink
NumberController Step is working properly
Browse files Browse the repository at this point in the history
See details about issue in
dataarts#48 (comment)
  • Loading branch information
anhr committed Feb 3, 2019
1 parent a1547d0 commit af02b71
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/dat/controllers/NumberController.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class NumberController extends Controller {
_v = this.__max;
}

if (this.__step !== undefined && _v % this.__step !== 0) {
if (this.__step !== undefined && this.__step !== 0 && _v % this.__step !== 0) {
_v = Math.round(_v / this.__step) * this.__step;
}

Expand Down
2 changes: 1 addition & 1 deletion src/dat/controllers/NumberControllerBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class NumberControllerBox extends NumberController {
}

updateDisplay() {
this.__input.value = this.__truncationSuspended ? this.getValue() : roundToDecimal(this.getValue(), this.__precision);
this.__input.value = this.__truncationSuspended || this.__step === 0 ? this.getValue() : roundToDecimal(this.getValue(), this.__precision);
return super.updateDisplay();
}
}
Expand Down

0 comments on commit af02b71

Please sign in to comment.