Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slider - onSlideEnd not called when clicking on Slider rail #2265

Closed
nazar opened this issue Aug 31, 2021 · 0 comments
Closed

Slider - onSlideEnd not called when clicking on Slider rail #2265

nazar opened this issue Aug 31, 2021 · 0 comments
Assignees
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Milestone

Comments

@nazar
Copy link

nazar commented Aug 31, 2021

I'm submitting a ...

[x] bug report
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://forum.primefaces.org/viewforum.php?f=57

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 Slider value but that doesn't quite work as expected since this debounced useEffect 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 ]

  • Language: [all | TypeScript X.X | ES6/7 | ES5]
@mertsincan mertsincan self-assigned this Nov 6, 2021
@mertsincan mertsincan added the Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add label Nov 6, 2021
@mertsincan mertsincan added this to the 7.0.0.Final milestone Nov 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Projects
None yet
Development

No branches or pull requests

2 participants