Skip to content

Commit

Permalink
Restore some slider change
Browse files Browse the repository at this point in the history
  • Loading branch information
piitaya committed Feb 27, 2023
1 parent a98a03a commit 51c2209
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions src/shared/slider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class SliderItem extends LitElement {
public showIndicator?: boolean;

@property({ attribute: false, type: Number, reflect: true })
public value?: number | string;
public value?: number;

@property({ type: Number })
public step: number = 1;
Expand Down Expand Up @@ -155,18 +155,6 @@ export class SliderItem extends LitElement {
}

protected render(): TemplateResult {
let value: number = 0;
switch (typeof this.value) {
case "string": {
value = parseFloat(this.value);
break;
}
case "number": {
value = this.value;
break;
}
}

return html`
<div
class=${classMap({
Expand All @@ -179,7 +167,7 @@ export class SliderItem extends LitElement {
id="slider"
class="slider"
style=${styleMap({
"--value": `${this.valueToPercentage(value)}`,
"--value": `${this.valueToPercentage(this.value ?? 0)}`,
})}
>
<div class="slider-track-background"></div>
Expand Down

0 comments on commit 51c2209

Please sign in to comment.