Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug(MatSlider): "showTickMarks" cash if updating mat-slider from api callback #29496

Open
1 task
chiLinh0412 opened this issue Jul 27, 2024 · 3 comments
Open
1 task
Labels
area: material/slider P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@chiLinh0412
Copy link

chiLinh0412 commented Jul 27, 2024

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

``I have problem with Range slider when i need to get min, max from an API call. The console show no error but my app just freeze completely. If i remove [showTickMarks], problem solved !

slider.html
<mat-slider class="filter-slider" [min]="this.soldeMin" [max]="this.soldeMax" [discrete]="true" [showTickMarks]="true"> <input matSliderStartThumb [(ngModel)]="filterSoldeMin"> <input matSliderEndThumb [(ngModel)]="filterSoldeMax"> </mat-slider>

slider.ts
``
soldeMin: number = 0;
soldeMax: number = 3000;

ngOnInit(): void {
    this.api.get().subscribe(res => {
        this.soldeMin = res.solde_min;
        this.soldeMax = res.solde_max;
    })
}

``

Reproduction

StackBlitz link: https://stackblitz.com/edit/qifxvd?file=src%2Fexample%2Fslider-range-example.ts,src%2Fexample%2Fslider-range-example.html,src%2Fexample%2Fslider-range-example.css
Steps to reproduce:
1.
2.

Expected Behavior

App not freeze

Actual Behavior

App freeze

Environment

  • Angular: 16.2.0
  • CDK/Material: 16.2.8
  • Browser(s): Edge, Chrome
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows
@chiLinh0412 chiLinh0412 added the needs triage This issue needs to be triaged by the team label Jul 27, 2024
@mmalerba mmalerba added the needs: clarification The issue does not contain enough information for the team to determine if it is a real bug label Aug 6, 2024
@mmalerba
Copy link
Contributor

mmalerba commented Aug 6, 2024

Please provide a reproduction to help us investigate

@chiLinh0412
Copy link
Author

chiLinh0412 commented Aug 27, 2024

Hello @mmalerba,

After testing, i found out the problem come from "showTickMarks" when the "max" value is too big ( ~ 50000).

https://stackblitz.com/edit/qifxvd?file=src%2Fexample%2Fslider-range-example.ts

@crisbeto
Copy link
Member

I suspect the issue is that each tick mark is rendered out as a DOM node.

@crisbeto crisbeto added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent area: material/slider and removed needs: clarification The issue does not contain enough information for the team to determine if it is a real bug needs triage This issue needs to be triaged by the team labels Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: material/slider P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

No branches or pull requests

3 participants