bug(mat-slider): Max value not updating correctly when new value is 0
See original GitHub issueIs 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 am changing slider’s max value in my component while/after doing some works. And it seems it has a problem updating visually when new max value is 0.
Reproduction
Steps to reproduce:
- Define slider like this:
<mat-slider min="0" [displayWith]="displayValue" [max]="maxValue" step="1" [thumbLabel]="true" [tickInterval]="1" [(ngModel)]="sliderValue" (ngModelChange)="changeSliderValue()"></mat-slider>
- Default sliderValue is 0, maxValue is 0.
- Click a button and change maxValue - let’s say to 6. Updates slider and ticks correctly.
- Click another button and change maxValue to 0. Updates slider and ticks incorrectly, shows previous ticks.
- You can see the same bug here: https://material.angular.io/components/slider/examples
Expected Behavior
Updating slider and ticks correctly.
Actual Behavior
Updated slider and ticks incorrectly.
Environment
- Angular: 10.2.0
- CDK/Material: 11.0.2
- Browser(s): Chome
- Operating System (e.g. Windows, macOS, Ubuntu): Windows 10 x64
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
mat-slider: not updating immediately on drag - Stack Overflow
but for some reason, when dragging the slider handle, it does not move to its new position until the mouse is released, which...
Read more >NG0100: Expression has changed after it was checked - Angular
Angular throws an ExpressionChangedAfterItHasBeenCheckedError when an expression value has been changed after change detection has completed.
Read more >@material/slider - npm
This is an example of a range slider with internal values of [min, max] = [0, 100] and [start, end] = [30, 70]...
Read more >Angular Material Slider - YouTube
Step by step beginner's tutorial on how to use Angular Material Slider. This component is used to allow the user to select a...
Read more >CHANGELOG_ARCHIVE.md - components - Fossies
6.0.0-rc.5 (2018-04-13). Bug Fixes. schematics: move ng-update under correct location (d98fb35). 6.0.0- ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey, thx for your reply. it’s not urgent at all, for me at least 😃. I’ll close my PR then and feel free to push your one .
@DMezhenskyi Feel free to send a PR