Slider - onSlideEnd not called when clicking on Slider rail #2265
Labels
Type: Enhancement
Issue contains an enhancement related to a specific component. Additional functionality has been add
Milestone
I'm submitting a ...
Codesandbox Case (Bug Reports)
https://codesandbox.io/s/beautiful-snow-3xufd
Current behavior
The
onSlideEnd
fires as expected when a Slider handle is released during a slide.The issue is that the
onSlideEnd
behaviour is not fired when clicking on the Slider range itself.Expected behavior
The
onSlideEnd
should also fire when clicking on the Slider range.Minimal reproduction of the problem with instructions
Please see the CodeSandBox link above -
console.log('end')
is not triggered when clicking on the Slider range.We are currently migrating away from several third-party React components and trying to consolidate all these with PrimeReact.
We are trying to replace rc-slider with the PrimeReact Slider component.
rc-slider
has a onAfterChange event that we use to fire a query update when a user either releases a Slider or clicks on the Slider rail.Since the
onChange
event is frequently fired, we only use it internally in the component to render the handle positions and rely on an additional event when either the user releases a handle or clicks on the Slider rail to fire a query.I tried adding a debounced
useEffect
to monitor the Slidervalue
but that doesn't quite work as expected since this debounceduseEffect
fires whilst the user is moving the Slider handle very slowly.Please tell us about your environment:
React version:
17.0.2
PrimeReact version:
6.5.1
Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
The text was updated successfully, but these errors were encountered: