Skip to content

Commit

Permalink
fix(bal-input-slider): round value for line drawing
Browse files Browse the repository at this point in the history
  • Loading branch information
mladenplaninicic committed Dec 15, 2022
1 parent e9563c8 commit 693f5a4
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ export class InputSlider {
}

private cssWidth(isUpper = false): string {
const a: number = this.value === '' ? 0 : (this.value as number)
const a: number = this.value === '' ? 0 : Math.round(Number(this.value) / this.step) * this.step
const b: number = (100 / this.max) * a

if (!isUpper) {
Expand Down Expand Up @@ -307,7 +307,7 @@ export class InputSlider {
step={this.step}
min={this.min}
max={this.max}
value={this.value}
value={this.value !== '' && this.value !== undefined ? this.value : 0}
onInput={this.onInput}
onBlur={this.onBlur}
onFocus={this.onFocus}
Expand Down

0 comments on commit 693f5a4

Please sign in to comment.