Package
v4.x
Context
I have an input that users can type longitude and latitude. To fit my zod schema, I had to put type="number" in my input. Since longitude and latitude don't have a fix amount of decimals, I want the user to be able to write 50.111 as well as 50.1111111, etc.
I didn't really changed the step and I don't mind, so I kept it as is (step by 1). If by example the value of longitude was 70.237823 and a user increments, it'll jump to 71.237823 without snapping. Since lng and lat have a minimum and maximum value, I added min="-180" max="180" (for longitude). Now if a user increment 71.237823, it'll snap to 72.
I know UInputNumber has a stepSnapping prop. So I made some tests.
Suggestion
Add stepSnapping prop that will work with input type number.
Repro and tests
Package
v4.x
Context
I have an input that users can type longitude and latitude. To fit my zod schema, I had to put type="number" in my input. Since longitude and latitude don't have a fix amount of decimals, I want the user to be able to write 50.111 as well as 50.1111111, etc.
I didn't really changed the step and I don't mind, so I kept it as is (step by 1). If by example the value of longitude was 70.237823 and a user increments, it'll jump to 71.237823 without snapping. Since lng and lat have a minimum and maximum value, I added min="-180" max="180" (for longitude). Now if a user increment 71.237823, it'll snap to 72.
I know UInputNumber has a stepSnapping prop. So I made some tests.
Suggestion
Add stepSnapping prop that will work with input type number.
Repro and tests