nuxt / nuxt/ui

`UInputNumber`: Disable automatically snapping values to `step`

Open
#6,385 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

triage
Dominant language
TypeScript
Stars
6.9k
Forks
1.1k
Avg merge
1d 7h
Merged PRs (30d)
57

Description

Package

v4.x

Description

No, this is not about stepSnapping prop.

Let's say there is a field with min 10 and max 100. I have set the step as 10. So if the user increases the value using keyboard arrows or buttons, it will increase by 10. But I would like the user to be able to set custom values as well. E.g. If user wants to set value 25, then he should be able to. But, currently, after leaving the input the entered 25 becomes 20 (or 30) snapping to the step. I don't want to set stepSnapping to false because then the user loses the 10, 20, 30... steps, instead it becomes 25, 35, 45. I still want to keep the steps as it is, but allow for custom values as well.

Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the UInputNumber implementation and trace how values are normalized when the input loses focus; reproduce the case with min 10, max 100, and step 10. Done means arrow and button changes still use step-sized increments while a manually entered value such as 25 remains 25 after leaving the input.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.