primefaces / primefaces/primereact
Inconsistent behavior when replacing input value with decimal point in InputNumber
Nobody has claimed this yet.
- Dominant language
- CSS
- Stars
- 8.3k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Description
Title:
Hello Everyone 👋
I noticed an inconsistency in the InputNumber component when handling replacement of values with the decimal point (.).
Steps to reproduce
- Type a number in the input (e.g. 123).
- Select the entire number.
- Press . (decimal point).
- The input gets cleared (empty).
- Press . again → now the input becomes 0.00.
Expected behavior
When selecting an existing value and pressing dot "." or "," (depends on the numbers system) , the field should immediately be replaced with 0.00 (similar to how selecting a number and typing another digit replaces the entire input).
This would make the behavior consistent with how other characters/digits work when replacing a selected value.
Current behavior
First press of "." clears the input.
Only after pressing . again does it add 0.00.
Why this matters
It is inconsistent compared to typing a number after selecting text.
Suggested improvement
When the entire input is selected and . is pressed:
Replace the content with 0.00x immediately (instead of clearing first).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the InputNumber component and reproduce the selection-and-decimal-point sequence for both dot and comma decimal systems. Trace how the selected value is replaced and verify the change by confirming that the first decimal-point press produces 0.00 immediately, without an intermediate empty state.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100