Opened 8 years ago

Closed 8 years ago

#7973 closed bug (fixed)

Slider: slide event even.target not slider element with jquery 1.7.1

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

Description

Minimal Reproduction case: http://jsbin.com/usobux/4

Version of JQuery: 1.7.1

Browser: Chrome 16.0.912.63 m

OS: Windows 7

Reproduction instructions:

  1. Visit http://jsbin.com/usobux/4
  2. Drag the slider

Expected Behavior: Div's text changes to indicate the new slider value

Actual Behavior: If cursor is outside of the slider area when the drag moves to the new value, the slide function does not appear to update properly.

This appears to work fine in an older version of JQuery (1.5.3)

Change History (3)

comment:1 Changed 8 years ago by jmcfar

Sorry, I meant that the slider appears to work properly in JQuery 1.5.2.

comment:2 Changed 8 years ago by rdworth

Status: newopen
Summary: Slider: Dragging misses events with jquery 1.7.1Slider: slide event even.target not slider element with jquery 1.7.1

Summary was: "Slider: Dragging misses events with jquery 1.7.1"

The slide event is always triggering. You can see this by

$("body").append(ui.value)

or

console.log(ui.value)

There is indeed a difference based on the jQuery versions used in the linked test case. But it's based solely on whether, in the slide event

this === event.target

It seems as though with versions of jQuery previous to 1.7.0, the event.target of the slide event is always the slider element. Starting with jQuery 1.7.0, it seems

event.target === event.originalEvent.target

which doesn't seem useful or expected. (Not useful because if you want the originalEvent.target, you can get it by event.originalEvent.target. Not expected because the target of the slide event should indeed be the slider element, not the element over which the mouse is when the slide occurred.)

comment:3 Changed 8 years ago by Scott González

Milestone: 1.91.8.17
Resolution: fixed
Status: openclosed

This is essentially a duplicate of #7852, which is already fixed.

Note: See TracTickets for help on using tickets.