react-component / react-component/slider
Custom Handlers will cause crashes without .clickFocus
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 3.1k
- Forks
- 768
- Avg merge
- 11d 22h
- Merged PRs (30d)
- 5
Description
When clicking on the marks to move the handle, the slider will crash with the following error if you're using a custom handle.
Uncaught TypeError: _this.handlesRefs[_this.prevMovedHandleIndex].clickFocus is not a function
at ComponentEnhancer._this.onMouseUp (createSlider.js:159)
The workaround is to add a clickFocus class function on your custom handle. Not the end of the world but this is still a slight nuance as it cancels out the new way the library handles focus. Perhaps there is a better workaround. This should only effect version 8.6.2 since previous versions handle focus differently.
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 createSlider.js line 159, in the onMouseUp path that calls clickFocus on the previously moved custom handle. Check how custom handles are represented and preserve focus behavior without requiring the workaround; done means clicking marks with a custom handle no longer crashes in version 8.6.2.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100