#7933 closed enhancement (wontfix)
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.
Change History (5)
comment:1 follow-up: 2 Changed 11 years ago by
Component: | ui.core → ui.slider |
---|---|
Resolution: | → wontfix |
Status: | new → closed |
comment:2 Changed 11 years ago by
Replying to 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?
comment:3 follow-up: 4 Changed 11 years ago by
Not unless your patch doesn't add an option to spinner.
comment:5 Changed 11 years ago by
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.