Skip to content

Commit 7640acd

Browse files
authored
fix(material/slider): form control w/ initial disabled state (#25972)
* fix(material/slider): form control w/ initial disabled state * fixup! fix(material/slider): form control w/ initial disabled state
1 parent a582e0a commit 7640acd

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/material/slider/slider-input.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,13 @@ export class MatSliderThumb implements _MatSliderThumb, OnDestroy, ControlValueA
275275
/** @docs-private */
276276
initProps(): void {
277277
this._updateWidthInactive();
278-
this.disabled = this._slider.disabled;
278+
279+
// If this or the parent slider is disabled, just make everything disabled.
280+
if (this.disabled !== this._slider.disabled) {
281+
// The MatSlider setter for disabled will relay this and disable both inputs.
282+
this._slider.disabled = true;
283+
}
284+
279285
this.step = this._slider.step;
280286
this.min = this._slider.min;
281287
this.max = this._slider.max;

0 commit comments

Comments
 (0)