From 3ee01128656ffeee1ca2bf7ee124dad37922c416 Mon Sep 17 00:00:00 2001 From: Wagner Maciel Date: Fri, 23 Dec 2022 15:47:06 +0000 Subject: [PATCH] fix(material/slider): avoid updating tick marks unnecessarily --- src/material/slider/slider.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/material/slider/slider.ts b/src/material/slider/slider.ts index 56c6d7d229dc..bc5134325249 100644 --- a/src/material/slider/slider.ts +++ b/src/material/slider/slider.ts @@ -797,7 +797,7 @@ export class MatSlider /** Updates the width of the tick mark track. */ private _updateTickMarkTrackUI(): void { - if (this._skipUpdate()) { + if (!this.showTickMarks || this._skipUpdate()) { return; } @@ -883,7 +883,12 @@ export class MatSlider /** Updates the dots along the slider track. */ _updateTickMarkUI(): void { - if (this.step === undefined || this.min === undefined || this.max === undefined) { + if ( + !this.showTickMarks || + this.step === undefined || + this.min === undefined || + this.max === undefined + ) { return; } const step = this.step > 0 ? this.step : 1;