Skip to content

Commit a582e0a

Browse files
authored
fix(material/slider): update VI when toggling discrete (#25985)
* fix(material/slider): update VI when toggling discrete * Fixes an issue where the value indicator ui is not initialized when toggling discrete on * fixup! fix(material/slider): update VI when toggling discrete * fixup! fix(material/slider): update VI when toggling discrete
1 parent 29f6b6b commit a582e0a

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

src/material/slider/slider.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ export class MatSlider
135135
}
136136
set discrete(v: BooleanInput) {
137137
this._discrete = coerceBooleanProperty(v);
138+
this._updateValueIndicatorUIs();
138139
}
139140
private _discrete: boolean = false;
140141

@@ -485,8 +486,7 @@ export class MatSlider
485486
eInput._updateStaticStyles();
486487
sInput._updateStaticStyles();
487488

488-
this._updateValueIndicatorUI(eInput);
489-
this._updateValueIndicatorUI(sInput);
489+
this._updateValueIndicatorUIs();
490490

491491
this._hasViewInitialized = true;
492492

@@ -773,6 +773,19 @@ export class MatSlider
773773
}
774774
}
775775

776+
/** Updates all value indicator UIs in the slider. */
777+
private _updateValueIndicatorUIs(): void {
778+
const eInput = this._getInput(_MatThumb.END);
779+
const sInput = this._getInput(_MatThumb.START);
780+
781+
if (eInput) {
782+
this._updateValueIndicatorUI(eInput);
783+
}
784+
if (sInput) {
785+
this._updateValueIndicatorUI(sInput);
786+
}
787+
}
788+
776789
// Update Tick Mark Track Width
777790
//
778791
// 1. Min, max, or step

0 commit comments

Comments
 (0)