react-component / react-component/input-number

Regression with v7: precision and formatter collide

Open
#320 1 comment 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
323
Forks
188
Avg merge
20h 3m
Merged PRs (30d)
1

Description

Since v7, the precision is skipped if a formatter is passed.

Here's an example with precision 2 and a formatter adding columns for every thousand: 100,000.00

With v6.1.2:
https://codesandbox.io/s/spring-sunset-dwr0o?file=/src/App.js

With v7
https://codesandbox.io/s/trusting-dan-vmhmc?file=/src/App.js

Here's the fault line: https://github.com/react-component/input-number/blob/master/src/InputNumber.tsx#L175

I am not sure what the right fix would be though.

Contributor guide

No contributing guide indexed for this repository

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 InputNumber.tsx around line 175 and reproduce the precision and formatter behavior using the linked v6.1.2 and v7 CodeSandbox examples. Confirm that precision is preserved when a formatter adds thousands separators; done means the v7 behavior matches the stated 100,000.00 result.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.