Description
Describe the bug
If I use keyboard arrows to move slider, onAfterChange
never gets triggered. Changing focus/pressing other keys does not help, the only way is to click the slider.
To Reproduce
- click the slider
- press left or right
- observe if onAfterChange got triggered (not for me)
If required I'll try to build a small app that demonstrates this. The current app I'm working on is unfortunately not public yet.
Expected behavior
I guess postponing the afterChange events on keystrokes a bit is okay, but the event should eventually trigger. I guess either focus loss or timeout are good candidates to do that while limiting the rate; and I'd vote for triggering it after each keystroke (since keystrokes are usually ratelimited already).
If not, it might be nice to document this for the users (and preferably find a workarond, I guess detecting keyboard events from onChange
could work?).
My Setup
This is a complete default react-bootstrap app with react-scripts. Dependencies are below, if it helps anything.
{
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.3.0",
"@testing-library/user-event": "^13.5.0",
"@types/jest": "^27.5.2",
"@types/node": "^16.11.47",
"@types/react": "^18.0.15",
"@types/react-dom": "^18.0.6",
"bootstrap": "^5.2.0",
"prettier": "^2.7.1",
"react": "^18.2.0",
"react-bootstrap": "^2.5.0",
"react-bootstrap-range-slider": "^3.0.8",
"react-dom": "^18.2.0",
"react-feather": "^2.0.10",
"react-markdown": "^8.0.3",
"react-router-bootstrap": "^0.26.2",
"react-router-dom": "^6.3.0",
"react-scripts": "5.0.1",
"sass": "^1.54.3",
"si-prefix": "^0.2.0",
"typescript": "^4.7.4",
"web-vitals": "^2.1.4"
}
Please let me know in case any further info is needed.
Thanks for all the sliders! :]
-mk