-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Long decimals from slider value when steps are .1 #10951
Comments
When a slider has a decimal step, we can end up with a value being assigned to the model that looks like 33.300000000000004. These changes ensure that the value is rounded to the same amount of decimals as the step. Fixes angular#10951.
When a slider has a decimal step, we can end up with a value being assigned to the model that looks like 33.300000000000004. These changes ensure that the value is rounded to the same amount of decimals as the step. Fixes #10951.
Hi with the new angular/material stack the issue is fixed for mouse event but not keybord. Try with the previous example with new angular stack : https://stackblitz.com/edit/angular-material6-example?file=app/app.component.html Use keyboard arrow you will see the same kind of problem. |
…step When incrementing a slider using the keyboard, the value can end up looking like 33.300000000000004, if the consumer set a decimal step. We fixed this a while ago for dragging, but that didn't cover the keyboard interactions. These changes move the logic from the earlier fix so it can apply everywhere. Relates to angular#10951.
Thanks for the heads-up @H3llK33p3r, I've submitted #11574 to sort it out. |
…step When incrementing a slider using the keyboard, the value can end up looking like 33.300000000000004, if the consumer set a decimal step. We fixed this a while ago for dragging, but that didn't cover the keyboard interactions. These changes move the logic from the earlier fix so it can apply everywhere. Relates to #10951.
…step When incrementing a slider using the keyboard, the value can end up looking like 33.300000000000004, if the consumer set a decimal step. We fixed this a while ago for dragging, but that didn't cover the keyboard interactions. These changes move the logic from the earlier fix so it can apply everywhere. Relates to #10951.
…step (#11574) When incrementing a slider using the keyboard, the value can end up looking like 33.300000000000004, if the consumer set a decimal step. We fixed this a while ago for dragging, but that didn't cover the keyboard interactions. These changes move the logic from the earlier fix so it can apply everywhere. Relates to #10951.
…step (#11574) When incrementing a slider using the keyboard, the value can end up looking like 33.300000000000004, if the consumer set a decimal step. We fixed this a while ago for dragging, but that didn't cover the keyboard interactions. These changes move the logic from the earlier fix so it can apply everywhere. Relates to #10951.
hassio 0.73.0 - this is still a problem, even using the mouse. my 2 input_numbers are defined in input_number.yaml the High slider has this bug - the values ending with .2 .4 and .7 .8 get values like #high comfort for climate control
the Low slider behaves correctly.
|
sorry - by mistake i missed to see this is angular and not [directly] relevant to home assistant/hassio issue tracker. for now, please ignore my reporting that this is still an issue. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug, feature request, or proposal:
Bug
What is the expected behavior?
The value displayed in the from to be only 1 decimal when using 1 decimal steps
What is the current behavior?
Sometimes it is one decimal, sometimes it is many more.
This can also be observed in the Material Angular documentation
What are the steps to reproduce?
Editor URL: https://stackblitz.com/edit/angular-material2-example
App URL: https://angular-material2-example.stackblitz.io
What is the use-case or motivation for changing an existing behavior?
The existing behavior seems incorrect.
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Angular 5.2.8
Material 5.2.5
Is there anything else we should know?
It looks there have been attempts to address this in other areas like the thumb label. Not sure if it has come back or just never got fully addressed or if there is just something I am doing wrong.
Previous issue: #2511 , #2527
The text was updated successfully, but these errors were encountered: