bootstrap-slider icon indicating copy to clipboard operation
bootstrap-slider copied to clipboard

reversed: true should reverse what is in-selection classes

Open aarcro opened this issue 9 years ago • 9 comments
trafficstars

specifically when using an orientation: "vertical" slider. I would expect that reverse: true would cause in-selection to fill up from the bottom, not just reverse the labels.

Is there an easy way to do this that I'm missing?

https://jsfiddle.net/5x7LLtbc/1/

aarcro avatar May 16 '16 03:05 aarcro

Thinking about this more, this is probably intended behavior. That said, I'm fairly certain it's not possible to do what you're asking. Reverse is doing just what it's supposed to - reversing the slider. You still drag from left to right (or in this case, top to bottom). We don't have any case where the slider goes from right to left or bottom to top.

seiyria avatar May 16 '16 12:05 seiyria

Feature request? Right to left might be a little strange, but bottom to top I think is useful. My UI will be like filling up a thermometer.

What would it be called?

aarcro avatar May 16 '16 15:05 aarcro

Weird as though it may be, it would have to support both cases. Probably something like reverseSlider would be fine, the documentation for both would have to be very clear on what each option does, though, and reverseSlider would also set reverse to true (otherwise it wouldn't make any sense).

seiyria avatar May 16 '16 15:05 seiyria

yea i see what you mean. I would agree with @seiyria that the documentation would have to be explicit for this option and should include an example on our examples page (/tpl/index.tpl)

rovolution avatar May 16 '16 15:05 rovolution

Agreed, it should be implement for both horizontal and vertical.

Yes, docs would have to be clear. I don't think the implicit link makes sense. All four cases below seem valid to me:

3 to 5 selected on the right/high side of the range
reverseSlider, but not reverse
|-O-O-0=0=0=|
  1 2 3 4 5

1 to 2 selected on the left/low side
neither reverse nor reverseSlider
|=0=0-O-O-O-|
  1 2 3 4 5

1 to 3 selected on the right/low side of the range
reverseSlider, and reverse
|-O-O-0=0=0=|
  5 4 3 2 1

4 to 5 selected on the left/high side of the range
reverse, but not reverseSilder
|=0=0-O-O-O-|
  5 4 3 2 1

aarcro avatar May 16 '16 15:05 aarcro

Sure. I looked around at a few sliders and I've seen them support it as well. I still think it's strange but I won't let that get in the way of potential features.

seiyria avatar May 16 '16 15:05 seiyria

Any update regarding this issue?

docet85 avatar Mar 08 '18 13:03 docet85

No, but we're happy to accept a PR for this!

seiyria avatar Mar 08 '18 13:03 seiyria

adding selection: 'after' did the job

docet85 avatar Mar 08 '18 13:03 docet85