Skip to content

Commit

Permalink
fix(material/slider): fix animation issue (#28704)
Browse files Browse the repository at this point in the history
* 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)
  • Loading branch information
wagnermaciel committed Mar 11, 2024
1 parent 3b45502 commit 386f768
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/material/slider/slider-input.ts
Expand Up @@ -340,6 +340,8 @@ export class MatSliderThumb implements _MatSliderThumb, OnDestroy, ControlValueA
}

_onFocus(): void {
this._slider._setTransition(false);
this._slider._updateTrackUI(this);
this._setIsFocused(true);
}

Expand Down
3 changes: 3 additions & 0 deletions src/material/slider/slider-interface.ts
Expand Up @@ -142,6 +142,9 @@ export interface _MatSlider {
/** Updates the stored slider dimensions using the current bounding client rect. */
_updateDimensions: () => void;

/** Updates the scale on the active portion of the track. */
_updateTrackUI: (source: _MatSliderThumb) => void;

/** Used to set the transition duration for thumb and track animations. */
_setTransition: (withAnimation: boolean) => void;

Expand Down

0 comments on commit 386f768

Please sign in to comment.