Skip to content

Commit

Permalink
fix(limel-slider): adjust disabled state to material style
Browse files Browse the repository at this point in the history
fix #154
  • Loading branch information
BregenzerK authored and adrianschmidt committed Sep 10, 2019
1 parent 95f6e2f commit 0021f48
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
8 changes: 0 additions & 8 deletions src/components/slider/slider.scss
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,6 @@ $colorGrey: #999999;
top: 2rem;
}

.slider__readonly {
height: 100%;
opacity: 0;
position: absolute;
top: 0;
width: 100%;
}

.mdc-slider {
height: 2.8rem;
}
Expand Down
6 changes: 5 additions & 1 deletion src/components/slider/slider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ export class Slider {
this.mdcSlider.listen('MDCSlider:change', this.changeHandler);
}

public componentWillUpdate() {
this.mdcSlider.disabled = this.disabled;
}

public componentDidUnload() {
this.mdcSlider.destroy();
}
Expand All @@ -68,6 +72,7 @@ export class Slider {
aria-valuemax={this.valuemax}
aria-valuenow={this.value}
aria-label={this.label}
aria-disabled={this.disabled}
>
<div class="mdc-slider__track-container">
<div class="mdc-slider__track" />
Expand All @@ -89,7 +94,6 @@ export class Slider {
</div>
</div>
</div>
{this.disabled ? <div class="slider__readonly" /> : null}
</div>
);
}
Expand Down

0 comments on commit 0021f48

Please sign in to comment.