[Bug] Slider option within inputDialog showing incorrect value visually
Closed this issue · 1 comments
Describe the bug
A clear and concise description of what the bug is.
When using an inputDialog with a slider option, it shows weird numbers visually for the user.
I've attached two examples. It will basically be the expected value + 0.0000000 and then a value from 1-7 typically.
To Reproduce
Steps to reproduce the behavior:
- Create an inputDialog with a slider option, using the below code:
local Input =
lib.inputDialog(
"Smoke Settings",
{
{type = "slider", label = "Size", default = 0.6, min = 0.1, max = 2.0, step = 0.05},
{type = "color", label = "Colour", default = "#fffaff"},
{type = "checkbox", label = "Reset To Default", checked = false}
}
)
Expected behavior
You would expect to see a numerical value incrementing either +- by 0.05 (the defined step value)
This behaviour happens normally for the majority of the slider but some of the values on the slider get adjusted to this weird value with lots of 000s.
Here are some screenshots of the same menu but working fine:
When the inputDialog is finished, i parse the output and save the input. In the first image i attached, you'd expect 0.95 to be the value shown visually without the bug. 0.95 is the value you get from the promise so when the user reopens the menu, the default is their default size (for this issue i hardcoded 0.6, normally it pulls a variable). When it defaults their last selected size, the number fills normally. If you select a different part of the slider e.g i default the value to 0.45, then i select 0.6 and go back to 0.45, it will have the visual issue again.
Additional context
I'm running the latest release of ox_lib at the time of this post - v3.24.0
This is not a bug with ox_lib, rather with JavaScript itself.