Skip to content

Commit 386f768

Browse files
committed
fix(material/slider): fix animation issue (#28704)
* the slider track animation would break in the case where a user clicks one thumb, tabs to the other, then uses an arrow key to change value. * for some reason, this bug only happens when the slider is not discrete. (cherry picked from commit 27cb903)
1 parent 3b45502 commit 386f768

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/material/slider/slider-input.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,8 @@ export class MatSliderThumb implements _MatSliderThumb, OnDestroy, ControlValueA
340340
}
341341

342342
_onFocus(): void {
343+
this._slider._setTransition(false);
344+
this._slider._updateTrackUI(this);
343345
this._setIsFocused(true);
344346
}
345347

src/material/slider/slider-interface.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,9 @@ export interface _MatSlider {
142142
/** Updates the stored slider dimensions using the current bounding client rect. */
143143
_updateDimensions: () => void;
144144

145+
/** Updates the scale on the active portion of the track. */
146+
_updateTrackUI: (source: _MatSliderThumb) => void;
147+
145148
/** Used to set the transition duration for thumb and track animations. */
146149
_setTransition: (withAnimation: boolean) => void;
147150

0 commit comments

Comments
 (0)