Ticket #4388 (open feature)

Opened 4 years ago

Last modified 7 months ago

slider range option should work with more than two handles

Reported by: vitch Owned by:
Priority: major Milestone: 1.11.0
Component: ui.slider Version: 1.7.1
Keywords: Cc:
Blocking: Blocked by:

Description

Currently the range option in ui.slider doesn't work where there are more than two handles (in fact, it resets the values passed in so they both equal values[0]).

For my current use case the user should be able to select a range including a mid value (they are selecting a "typical", "min" and "max" size).

I propose that you should be able to have a range slider with more than two handles. In the simplist case it can be assumed that the first handle is the bottom of the range and the last handle is the top of the range. This will cover my use-case. I can also see a possible requirement for more complex ranges where the user could specify which handles represented ranges.

Attachments

ui.slider.4388.diff Download (2.5 KB) - added by vitch 4 years ago.
Patch including fix for #4388

Change History

Changed 4 years ago by vitch

Patch including fix for #4388

comment:1 Changed 4 years ago by vitch

The attached patch seems to work for me. It may need more careful testing to check it works in all circumstances though. I was unable to figure out how the animate parameter was meant to work so I couldn't test that the logic worked there but I shouldn't have disturbed anything.

There was also some unused variables (vp0 and vp1) which I removed and I simplifed a little of the code by calcualing some local variables outside a loop.

comment:2 Changed 4 years ago by vitch

comment:3 Changed 4 years ago by rdworth

  • Type changed from bug to feature

comment:4 Changed 4 years ago by joern.zaefferer

  • Milestone changed from TBD to 1.8

Patch needs testing.

comment:5 Changed 4 years ago by joern.zaefferer

Duplicate of #4387?

comment:6 Changed 2 years ago by NickHeiner

I implemented my own version of this before realizing that it had already been done here. It lets the user specify values for as many sliders as he wants, and set a CSS class for each range. Is it worth it to fork and send a pull request, or will the project probably go with the code that's already posted here?

comment:7 Changed 2 years ago by scott.gonzalez

Likely neither; slider is undergoing an API redesign in which it will likely be split into multiple widgets.

comment:8 Changed 21 months ago by scott.gonzalez

#7703 is a duplicate of this ticket.

comment:9 Changed 7 months ago by scott.gonzalez

  • Milestone changed from 1.9.0 to 1.11.0

comment:10 Changed 7 months ago by tj.vantoll

  • Status changed from new to open
Note: See TracTickets for help on using tickets.