From 890765bf4329db9b8ab9eb097ad0877facb98587 Mon Sep 17 00:00:00 2001 From: Wagner Maciel Date: Tue, 14 Feb 2023 19:47:43 +0000 Subject: [PATCH] fix(material/slider): make valueChange emit only on change and not on input (#26535) (cherry picked from commit 6d89b9de0592a5a0ee60b15e72b89188a53d5a66) --- src/material/slider/slider-input.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/material/slider/slider-input.ts b/src/material/slider/slider-input.ts index 193ac10e4a12..6b8171f8cc0e 100644 --- a/src/material/slider/slider-input.ts +++ b/src/material/slider/slider-input.ts @@ -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) { @@ -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.