Skip to content

Commit

Permalink
Fitst attempt to fix issue #16
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitrySharabin committed May 15, 2024
1 parent 61be842 commit b1686eb
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/color-slider/color-slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,15 @@ const Self = class ColorSlider extends NudeElement {
if (["min", "max", "step", "value", "defaultValue"].includes(name)) {
prop.applyChange(this._el.slider, change);

let spinnerValue = this.tooltip === "progress" ? +(this.progress * 100).toPrecision(4) : this.value;
let spinnerValues = this;
if (this.tooltip === "progress") {
spinnerValues = {min: 0, max: 100, step: 1};

if (name === "value" || name === "defaultValue") {
spinnerValues[name] = +(this.progress * 100).toPrecision(4);
}
}
let spinnerValue = spinnerValues[name] ?? this[name];
prop.applyChange(this._el.spinner, {...change, value: spinnerValue});
}

Expand Down

0 comments on commit b1686eb

Please sign in to comment.