Skip to content

UInput type number, add stepSnapping prop #6429

@Ombrenoirz

Description

@Ombrenoirz

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesttriageAwaiting initial review and prioritizationv4#4488

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions