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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Slider] Allow disabling the left and right thumbs swap #24831

Closed
1 task
SunShinewyf opened this issue Feb 8, 2021 · 13 comments 路 Fixed by #25547
Closed
1 task

[Slider] Allow disabling the left and right thumbs swap #24831

SunShinewyf opened this issue Feb 8, 2021 · 13 comments 路 Fixed by #25547
Labels
component: slider This is the name of the generic UI component, not the React module! new feature New feature or request ready to take Help wanted. Guidance available. There is a high chance the change will be accepted

Comments

@SunShinewyf
Copy link

SunShinewyf commented Feb 8, 2021

  • I have searched the issues of this repository and believe that this is not a duplicate.

Summary 馃挕

the bar on the left cannot exceed the bar on the right, hope that there is an api to control it
image

Examples 馃寛

Motivation 馃敠

@SunShinewyf SunShinewyf added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Feb 8, 2021
@SunShinewyf
Copy link
Author

SunShinewyf commented Feb 8, 2021

I hope that the left and right bars cannot overlap and the direction cannot be interchanged, but there is no api can do this, please help to add an api to control this, hope to get your reply as soon as possible, thanks~

@oliviertassinari
Copy link
Member

@SunShinewyf Could you provide more details on your use case? Why do you need this behavior?

@oliviertassinari oliviertassinari added the component: slider This is the name of the generic UI component, not the React module! label Feb 8, 2021
@remyoudemans

This comment has been minimized.

@oliviertassinari
Copy link
Member

@remyoudemans Do you have a visual example? It would help

@remyoudemans
Copy link
Contributor

Reading this again, I think @SunShinewyf's issue is totally unrelated to mine.
Where @SunShinewyf wanted a range slider where the thumbs couldn't pass each other, I was just talking about a slider where the sides of the thumb can't stick out past the edges of the rail.

Sorry for the confusion!

@oliviertassinari
Copy link
Member

Alright, I'm closing for now as thumbs passing each other, is in theory fine.

@oliviertassinari oliviertassinari added status: waiting for author Issue with insufficient information and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Feb 10, 2021
@SunShinewyf
Copy link
Author

SunShinewyf commented Feb 19, 2021

@SunShinewyf Could you provide more details on your use case? Why do you need this behavior?

I'm sorry to see your reply so late, my use case just like a slider in a video clip, when the left bar and the right bar are in the same position, they can't drag, I don't want that thumbs can pass each other, so I hope that there is an API to control this

@oliviertassinari oliviertassinari removed the status: waiting for author Issue with insufficient information label Feb 19, 2021
@SunShinewyf
Copy link
Author

Would like to ask whether the current version can meet such requirement? our projects are a little urgent

@oliviertassinari
Copy link
Member

oliviertassinari commented Feb 22, 2021

@SunShinewyf I have no idea. Did you look into how the Slider's source can be updated to support it? Maybe we could have a prop for it if the implementation is simple enough?

@SunShinewyf
Copy link
Author

@oliviertassinari Not yet, let me look into it

@chaddoncooper
Copy link

+1 for this, my use case is also based on a time range. I also need a minimum value between the two.

@oliviertassinari oliviertassinari added the new feature New feature or request label Mar 17, 2021
@oliviertassinari
Copy link
Member

I have tried to implement quickly the UX in https://codesandbox.io/s/rangeslider-material-demo-forked-63xq9?file=/demo.tsx by controlling the slider. I have found two blockers:

  1. The active thumb swaps to the nearest to the active pointer. We could add a prop to disable this behavior.

active thumb

  1. The onChange callback doesn't give information about the current active thumb. With such information, it would have allowed the implementation of the shift pattern in both directions

shift

So overall, it looks quite a simple problem to solve.

@oliviertassinari oliviertassinari added the ready to take Help wanted. Guidance available. There is a high chance the change will be accepted label Mar 17, 2021
@oliviertassinari oliviertassinari changed the title [Slider] the left bar and the right bar of range slider cannot be intersected [Slider] Allow disabling the left and right thumbs swap Mar 17, 2021
@anubhavb11
Copy link

how can i disable one of the thumb totally

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: slider This is the name of the generic UI component, not the React module! new feature New feature or request ready to take Help wanted. Guidance available. There is a high chance the change will be accepted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants