Skip to content

Commit

Permalink
fix(material/slider): form control w/ initial disabled state (#25972)
Browse files Browse the repository at this point in the history
* fix(material/slider): form control w/ initial disabled state

* fixup! fix(material/slider): form control w/ initial disabled state
  • Loading branch information
wagnermaciel committed Nov 17, 2022
1 parent a582e0a commit 7640acd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/material/slider/slider-input.ts
Expand Up @@ -275,7 +275,13 @@ export class MatSliderThumb implements _MatSliderThumb, OnDestroy, ControlValueA
/** @docs-private */
initProps(): void {
this._updateWidthInactive();
this.disabled = this._slider.disabled;

// If this or the parent slider is disabled, just make everything disabled.
if (this.disabled !== this._slider.disabled) {
// The MatSlider setter for disabled will relay this and disable both inputs.
this._slider.disabled = true;
}

this.step = this._slider.step;
this.min = this._slider.min;
this.max = this._slider.max;
Expand Down

0 comments on commit 7640acd

Please sign in to comment.