Skip to content

Commit

Permalink
fix(material/slider): avoid updating tick marks unnecessarily (#26322)
Browse files Browse the repository at this point in the history
  • Loading branch information
wagnermaciel committed Dec 28, 2022
1 parent 6f92144 commit 638be65
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/material/slider/slider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 638be65

Please sign in to comment.