You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Currently, when the developer sets the smallStep property of the Slider component to 0.01, the component stops working at a value of 0.29(if this value is skipped, the component then stops working at 0.57, 0.58, 1.13, etc.) - this means that the user can use the drag handle to change the value in the Slider, but the increment button cannot change this value.
To Reproduce
Create a Slider component.
Set the min, max, and value properties.
Set the smallStep property to 0.01.
Use the buttons to change the value in the Slider.
Expected behavior
The buttons for changing the value should work regardless of the value set to the component.
Additional context
The valueChange event is also not fired when the increment button stops working.
The problem seems to be related to the logic in the sliders-util.ts file, and more precisely the remainder function. The function divides 0.29 by 0.01 which gets us 28.999999999999996, which is then floored to 28 instead of rounded to 29.
Describe the bug
Currently, when the developer sets the
smallStep
property of the Slider component to 0.01, the component stops working at a value of 0.29(if this value is skipped, the component then stops working at 0.57, 0.58, 1.13, etc.) - this means that the user can use the drag handle to change the value in the Slider, but the increment button cannot change this value.To Reproduce
Please, check out the following StackBlitz demo: https://stackblitz.com/edit/angular-8n8e4e
Expected behavior
The buttons for changing the value should work regardless of the value set to the component.
Additional context
The
valueChange
event is also not fired when the increment button stops working.The problem seems to be related to the logic in the
sliders-util.ts
file, and more precisely theremainder
function. The function divides 0.29 by 0.01 which gets us 28.999999999999996, which is then floored to 28 instead of rounded to 29.Can be similar to #4360
The text was updated successfully, but these errors were encountered: