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

p-slider: Slider issue with onSlideEnd event and range selection #9013

Closed
dileepyelleti opened this issue Jul 7, 2020 · 4 comments · Fixed by #13711
Closed

p-slider: Slider issue with onSlideEnd event and range selection #9013

dileepyelleti opened this issue Jul 7, 2020 · 4 comments · Fixed by #13711
Assignees
Labels
LTS-PORTABLE Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@dileepyelleti
Copy link

I'm submitting a ... (check one with "x")

[x] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35

Plunkr Case (Bug Reports)
https://stackblitz.com/edit/github-xcnx2n

Current behavior

  1. onSlideEnd event will not be triggered if we click on bar to change value
  2. For range slider if selected ngModel value is not set initially or set to [min, min] then slider breaks and we can't slide at all

Expected behavior

  1. Should trigger onSlideEnd event whenever slider
  2. For range slider if selected ngModel value is not set initially or set to [min, min] then also it should work properly

Minimal reproduction of the problem with instructions
Issue 1:

  1. Open https://stackblitz.com/edit/github-xcnx2n
  2. Click on slider bar anywhere in middle
  3. Check console. onSlideEnd event won't be triggered.

Issue 2:

  1. Open https://stackblitz.com/edit/github-xcnx2n
  2. Go to app.component.ts and set selectedVal to [0, 0] or don't set to anything
  3. Then slider won't work

What is the motivation / use case for changing the behavior?

  1. We need to trigger http call when slider value changed. Currently we are using onSlideEnd to know when slider value updated. We can't even use onChange event as it will trigger continuously while dragging. Even with debounce we can't use onChange event because if user holds while dragging then it will trigger. So ideally there should be one event to know when slider value updated.

  2. Have a range slider filter based on query params. If user passes same values [min, min] then slider is broken and can't slide anymore

Please tell us about your environment:

  • Angular version: 5.X
    Angular 9.1.11

  • PrimeNG version: 5.X
    9.1.0

  • Browser: [all]
    all

  • Language: [all]
    all

  • Node (for AoT issues): node --version =
    12.1.0

@dileepyelleti dileepyelleti changed the title Slider issue with onSlideEnd event and range selection p-slider: Slider issue with onSlideEnd event and range selection Jul 7, 2020
@mmebsout
Copy link

I also have the problem for Issue 1 with Angular 7.2.16 and primeng 7.0.1 Browser all, Node 8.9.1
I suggest breaking this issue into two separate ones.

@mertsincan
Copy link
Member

Hi,

So sorry for the delayed response! Improvements have been made to many components recently, both in terms of performance and enhancement. Therefore, this improvement may have been developed in another issue ticket without realizing it. You can check this in the documentation. If there is no improvement on this, can you reopen the issue so we can include it in our roadmap?
Please don't forget to add your feedback as a comment after reopening the issue. These will be taken into account by us and will contribute to the development of this feature. Thanks a lot for your understanding!

Best Regards,

@dileepyelleti
Copy link
Author

@mertsincan
The issue is still there in new version. onSlideEnd event not getting triggered on clicking on bar
https://stackblitz.com/edit/github-p9xog7

I can't reopen issue from my side

@mertsincan mertsincan reopened this Nov 11, 2022
@github-actions github-actions bot added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Nov 11, 2022
@mshnajar
Copy link

mshnajar commented Dec 3, 2022

I changed my Slider component to ngx-slider until you fix this: When dragging several onChange + one onSlideEnd + one final onChange, But when clicking one onChange event with no onSlideEnd event.

@gucal gucal added this to the 16.3.2 milestone Sep 21, 2023
@gucal gucal self-assigned this Sep 21, 2023
@cetincakiroglu cetincakiroglu added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible Status: Pending Review Issue or pull request is being reviewed by Core Team labels Sep 21, 2023
cetincakiroglu added a commit that referenced this issue Sep 21, 2023
Fix #9013 - p-slider: Slider issue with onSlideEnd event
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LTS-PORTABLE Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants