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
I'm not sure if it's an issue or not, but I didn't find any solution for the cases when I need to keep my number to be integer with a change step of 1. So the workaround I'm using is manual rounding, like this:
If I remove this rounding, go to the scene and change the "detail" slider with Alt + Arrow Up/Down, the scene will crash, because the number changed by $\pm 0.1$ and became non-integer (but has to be integer).
But on the other hand, if this rounding is there and I'm changing the slider with the Alt + Arrow Up/Down, I have to press it 5+ times until the number is rounded over to the next step. And this happens because the Leva number is still changing by 0.1 under the hood, while it gets rounded for my application.
Questions
What's the proper / recommended way to deal with such cases? I didn't find a way how can I change it for controlled input immediately on each change.
Isn't this considered a bug on Leva side to keep the step value in mind and don't get below it? As an option, I'm also thinking maybe it's also worth to introduce a smallStep value for the full control over it?
About
Hi Poimandres team 👋
I'm not sure if it's an issue or not, but I didn't find any solution for the cases when I need to keep my number to be integer with a change step of 1. So the workaround I'm using is manual rounding, like this:
If I remove this rounding, go to the scene and change the "detail" slider with Alt + Arrow Up/Down, the scene will crash, because the number changed by$\pm 0.1$ and became non-integer (but has to be integer).
But on the other hand, if this rounding is there and I'm changing the slider with the Alt + Arrow Up/Down, I have to press it 5+ times until the number is rounded over to the next step. And this happens because the Leva number is still changing by
0.1
under the hood, while it gets rounded for my application.Questions
step
value in mind and don't get below it? As an option, I'm also thinking maybe it's also worth to introduce asmallStep
value for the full control over it?Links
Links to the use case:
The text was updated successfully, but these errors were encountered: