Search and Top Navigation
#7933 closed enhancement (wontfix)
Opened December 02, 2011 10:56PM UTC
Closed December 03, 2011 09:57PM UTC
Last modified December 05, 2011 04:00PM UTC
slider: snapping of value to floor/ceil rather than always nearest step
Reported by: | AlanKrueger | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 1.9.0 |
Component: | ui.slider | Version: | git (not yet released) |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Should there be an option that allows snapping a value to floor or ceil rather than whichever is closer?
For instance, say you have a text input and slider tied together, representing a maximum bid, with the slider set to $10 steps. If the user enters $55, this would result in the slider jumping to $60. This is greater than the maximum amount the user just entered, and seems like incorrect behavior.
If, however, there was an option to specify, say, stepType="floor" (rather than hypothetical default, stepType="round"), then the control would snap to the nearest lower value instead of the closest of the upper and lower.
Attachments (0)
Change History (5)
Changed December 03, 2011 09:57PM UTC by comment:1
component: | ui.core → ui.slider |
---|---|
resolution: | → wontfix |
status: | new → closed |
Changed December 05, 2011 03:19PM UTC by comment:2
Replying to [comment:1 scott.gonzalez]:
This shouldn't be in the plugin. If you want that behavior, you should adjust the value before setting the slider value.
So...the caller should replicate the snap-calculation logic themselves, external to the plugin, then tweak it?
Can we avoid tagging this "wontfix" until you see the patch I was putting together on github?
Changed December 05, 2011 03:30PM UTC by comment:3
Not unless your patch doesn't add an option to spinner.
Changed December 05, 2011 03:36PM UTC by comment:4
Can you elaborate a bit on your reasons for that response?
Changed December 05, 2011 04:00PM UTC by comment:5
It's unnecessary to support rounding types for slider to work properly and rounding to the nearest valid step follows HTML 5. Since the current implementation satisfies the overwhelming majority of users and does not restrict what you're asking for, we should not be adding an option.
This shouldn't be in the plugin. If you want that behavior, you should adjust the value before setting the slider value.