Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions src/material/slider/slider-input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ export class MatSliderThumb implements _MatSliderThumb, OnDestroy, ControlValueA

if (!this.disabled) {
this._handleValueCorrection(event);
this.dragStart.emit({source: this, parent: this._slider, value: this.value});
}
}

Expand Down Expand Up @@ -406,10 +407,7 @@ export class MatSliderThumb implements _MatSliderThumb, OnDestroy, ControlValueA
const impreciseValue =
fixedPercentage * (this._slider.max - this._slider.min) + this._slider.min;
const value = Math.round(impreciseValue / step) * step;

const prevValue = this.value;
const dragEvent = {source: this, parent: this._slider, value: value};
this._isActive ? this.dragStart.emit(dragEvent) : this.dragEnd.emit(dragEvent);

if (value === prevValue) {
// Because we prevented UI updates, if it turns out that the race
Expand Down Expand Up @@ -440,10 +438,11 @@ export class MatSliderThumb implements _MatSliderThumb, OnDestroy, ControlValueA
}

_onPointerUp(): void {
this._isActive = false;
setTimeout(() => {
this._updateWidthInactive();
});
if (this._isActive) {
this._isActive = false;
this.dragEnd.emit({source: this, parent: this._slider, value: this.value});
setTimeout(() => this._updateWidthInactive());
}
}

_clamp(v: number): number {
Expand Down