Ticket #7837 (closed bug: worksforme)

Opened 2 years ago

Last modified 2 years ago

Slider Value Off By One When Changing Directions

Reported by: lyden Owned by:
Priority: minor Milestone: 1.9.0
Component: ui.slider Version: 1.8.16
Keywords: Cc:
Blocking: Blocked by:

Description

After a slide event is fired, the slider returns the wrong value if the handle has just changed directions. If a default horizontal slider is increased to value 50, then pulled one step to the right, the value correctly increases to 51. If the slider is then pulled one step to the left, the value will INCREASE to 52. If the slider is then pulled another step to the left, the value will decrease to 51 and continue decreasing as long as the slider continues to be pulled to the left. The opposite also holds true. If a default horizontal slider decreased to value 50, then pulled one step to the left, the value correctly decreases to 49. If the slider is then pulled one step to the right, the value will DECREASE to 48 and then will increment normally as it's continued to be pulled to the right. Consequently, it's possible to slide one step left to INCREMENT by one, and then slide one step right to DECREMENT by one. This behavior is particular to the slide event. The change and stop events function as expected. This was noted in a minimalist test using both the latest versions of Chrome and Firefox on Windows 7.

Change History

comment:1 Changed 2 years ago by scott.gonzalez

  • Status changed from new to closed
  • Resolution set to worksforme

We're not seeing the behavior you describe.

comment:2 Changed 2 years ago by rdworth

My guess is that inside the slide event you are using $(this).slider("value") when you need to use ui.value. The former is the current/previous value. The latter is the next/new value. Both are provided as they are sometimes needed for comparison.

Note: See TracTickets for help on using tickets.