Skip to content

Commit

Permalink
fix(material/slider): make valueChange emit only on change and not on…
Browse files Browse the repository at this point in the history
… input (#26535)

(cherry picked from commit 6d89b9d)
  • Loading branch information
wagnermaciel committed Feb 14, 2023
1 parent 666cc1b commit 890765b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/material/slider/slider-input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ export class MatSliderThumb implements _MatSliderThumb, OnDestroy, ControlValueA
}

_onChange(): void {
this.valueChange.emit(this.value);
// only used to handle the edge case where user
// mousedown on the slider then uses arrow keys.
if (this._isActive) {
Expand All @@ -327,7 +328,6 @@ export class MatSliderThumb implements _MatSliderThumb, OnDestroy, ControlValueA
}

_onInput(): void {
this.valueChange.emit(this.value);
this._onChangeFn(this.value);
// handles arrowing and updating the value when
// a step is defined.
Expand Down

0 comments on commit 890765b

Please sign in to comment.