MultiSlider
MultiSlider copied to clipboard
Support for multiple snap step sizes
Description:
Support for multiple snap step sizes on one slider, e.g 2 and 4 The x value represents a size of 2. The y value represents a size of 4.
Here, snap step size should be 2. [x] - [x] - [x] - [x] - [ ] - [y] - [ ] - [y]
Here, snap step size should be 4. Allowing the first thumb to move to the next y ignoring the blank node which would be a 2 step. [x] - [x] - [x] - [x] - [ ] - [y] - [ ] - [y]
At the moment, there's only support for one step size and we were wondering if it would be possible to snap onto bigger gaps.
Problems we encountered when trying to implement this myself:
We've added an if statement to change the snap step size to 2 or 4 depending on where the second thumb is. This has caused the following problems.
-
When we try to move the first thumb onto the next y node, it snaps in between because it's making a size 2 step. [x] - [x] - [x] - [x] - [ ] - [y] - [ ] - [y] [x] - [x] - [x] - [x] - [!] - [y] - [ ] - [y]
-
When moving the last y node to the previous y, the x moves as well.
[x] - [x] - [x] - [x] - [y] - [y] [x] - [x] - [x] - [x] - [y] - [y]
We wanted to check if there is a more efficient way of doing this as we've spent lots of time trying to achieve the desired behaviour and creating a new Slider from UIControl proves to be somehow tricky for our team.
Thank you, Christian
Would you say more about what you are trying to achieve? Should the snap values be [2, 2, 2, 4, 4]? Or should they change when the rightmost thumb moves?
Added snapValues
in version 2.0.0.