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)
  • Loading branch information
wagnermaciel authored Feb 14, 2023
1 parent 6a0b74d commit 6d89b9d
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 6d89b9d

Please sign in to comment.