react-component / react-component/input-number
defaultParser isn't correct
Open
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 323
- Forks
- 188
- Avg merge
- 20h 3m
- Merged PRs (30d)
- 1
Description
the bug is here: https://github.com/react-component/input-number/blob/master/src/index.js#L16
Current regex matches any letter. I think the correct regex should look like /[^\d\.-]+/g
Contributor guide
No contributing guide indexed for this repository
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
Open src/index.js at line 16 and inspect the defaultParser definition and its current regular expression. Verify the parser's behavior for numeric input, letters, decimal points, and negative signs; the issue is done when non-numeric characters are filtered according to the requested behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100