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 strange behaviour when min and max properties don't match with their default values #10178

Closed
dloprodu opened this issue Apr 29, 2021 · 4 comments
Labels
Status: Pending Review Issue or pull request is being reviewed by Core Team

Comments

@dloprodu
Copy link

dloprodu commented Apr 29, 2021

[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

Current behavior
I have detected a bug when the min and max properties (in range mode) don't match with their default values.

If I move the start range control to the end (max value) the slider no longer works properly. That is, I'm not able to move again the start range control to another position.

image

Expected behavior

The slider control should work properly when min and max values aren't the default values and I move the start control to the end control.

Minimal reproduction of the problem with instructions
You can reproduce it very easy in your Slider control page, the StackBlitz area, changing the min and max values.

image

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

Please tell us about your environment:

  • Angular version: 11.2.3
  • PrimeNG version: 11.4.0
  • Browser: [all]

  • Language: [all]

@yigitfindikli yigitfindikli added the Status: Pending Review Issue or pull request is being reviewed by Core Team label Apr 30, 2021
@Phil-DS
Copy link

Phil-DS commented Apr 6, 2022

I've been encountering the issue on the same version as before, and still seems to be a problem on the current version of 13.

The issue was originally dealt with here: #9538, but the fixes don't work correctly.

if (this.range && this.handleValues && this.handleValues[0] === this.max) {
this.handleIndex = 0;
}
else {
this.handleIndex = index;
}

(Also in the onTouchStart function too)
This is because the variable 'handleValues' is in the range 0->100, not Slider.min->Slider.max. Therefore, if the max isn't 100, then the fix does not work. Needs to check if the max handle value is at 100, not Slider.min

Phil-DS added a commit to Phil-DS/primeng that referenced this issue Apr 7, 2022
Sliders will now use the lower handle when both are set to max.
@davidpawar
Copy link

Hey @Phil-DS,
I am not sure if it has anything to do with what you fixed here but I am facing a small issue with the range slider when both values are at the same value e.g 63 and 63. Then it's not possible to drag the handle to the left only to the right.
Is this even fixable? Because as far as I saw either one of the handles needs to be "at the top".

@Phil-DS
Copy link

Phil-DS commented Apr 30, 2022

Hey @Phil-DS, I am not sure if it has anything to do with what you fixed here but I am facing a small issue with the range slider when both values are at the same value e.g 63 and 63. Then it's not possible to drag the handle to the left only to the right. Is this even fixable? Because as far as I saw either one of the handles needs to be "at the top".

Yeah, that wasn't the problem I was fixing. It was just the case that, when both handles were at max, and it wasn't using the default maximum of 100, it wouldn't allow you to drag the handles. However, #11427 focuses on that problem and a fix was done in PR #11428. Hopefully, it also solves this issue too.

@cetincakiroglu
Copy link
Contributor

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,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Pending Review Issue or pull request is being reviewed by Core Team
Projects
None yet
5 participants