react-component / react-component/slider
OnChange functions for range component with count value of -1 has Array<number | undefined> return type
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 3.1k
- Forks
- 768
- Avg merge
- 11d 22h
- Merged PRs (30d)
- 5
Description
When the count prop is set to -1, the onChange, onAfterChange and onBeforeChange functions are passed a parameter of type [number, undefined]. Also, count values less than -1 result throw an exception. I propose that a better way to deal with this would be for the component to treat count values less than 1 like they were 1.
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
Start at the range component's count handling and the callback type definitions, then reproduce the count=-1 and count<-1 cases. Done means callback parameters no longer expose an undefined range value for nonpositive counts, and invalid counts no longer throw unexpectedly; add or update focused tests if the repository provides them.
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
- 45/100