angular / angular/components

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

未关闭
#29,496 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
area: material/slider P3
主要语言
TypeScript
星标
25k
派生
6.8k
平均合并
1 天 8 小时
30 天内合并 PR
91

描述

### 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
``


``

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](https://github.com/angular/components/issues/url)
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

贡献指南

打开贡献指南

调研方向

从 StackBlitz 文件 src/example/slider-range-example.ts、src/example/slider-range-example.html 和 src/example/slider-range-example.css 开始,然后将它们与报告中的 slider.html 和 slider.ts 设置进行比较。复现一个在启用 showTickMarks 时更新 min 和 max 的 API 回调;完成的标准是应用保持响应,且 range slider 正确更新。

由索引模型根据 Issue 内容生成。

评估

技术栈
angular, typescript
领域
frontend
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。