Open jonancastelo opened 2 months ago
I have discovered where the misunderstanding is.
In slider.ts can be seen in the method updateTickMarkTrackUI comments, that the maximum reachable value is different from the maximum value set by the user.
In MatSlider documentation however, it says that max is the maximum value that the slider can have.
The last assumption may hold true behind the scenes, but for the user, the maximum value that the slider can reach is the set max value. Consequently, this explanation could lead to misunderstanding for the user.
I propose 2 possible solutions:
// Calculate number of ticks
numberOfTicks = Math.floor( (max - min) / step)
// Calculate html input range min and max (minReachable and maxReachable respectively)
minReachable = min;
maxReachable = min + (numberOfTicks * step);
I could develop myself and make a pull request if you agree.
Hey @jonancastelo are you going to work on this issue, or can I?
Hi @GiftLanga, as there is no interest by the angular team I will not develop. Perhaps you can, good luck
Is this a regression?
The previous version in which this bug was not present was
No response
Description
There are some values of "min", "max" and "step" together with "showTickMars" that make tick marks to dm't be aligned with the position of the thumb.
In the shared stackblitz example can be seen that:
Reproduction
StackBlitz link: https://stackblitz.com/edit/components-issue-t6k1kc Steps to reproduce:
Expected Behavior
Actual Behavior
Environment