Skip to main content

Search and Top Navigation

#7251 closed bug (fixed)

Opened April 14, 2011 01:35PM UTC

Closed October 20, 2013 11:46PM UTC

Last modified October 20, 2013 11:49PM UTC

Draggable: constrained axis option returns incorrect position

Reported by: joshco Owned by: mikesherov
Priority: minor Milestone: 1.11.0
Component: ui.draggable Version: 1.8.11
Keywords: Cc: scottgonzalez
Blocked by: Blocking:
Description

when using draggabls with axis : 'y', it will constrain the movement of the entity visually. however, if the mouse is moved along the 'x' axis, the ui.position.left will return the delta of the mouse move.

The expected result is 0, ie no movement.

repros with Jquery 1.5.2

Attachments (0)
Change History (10)

Changed May 23, 2012 11:11AM UTC by znarkus comment:1

_comment0: I have the exact same problem. Created this jsfiddle to illustrate http://jsfiddle.net/Znarkus/m27CK/1337771607699066

I have the exact same problem. Created this jsfiddle to illustrate http://jsfiddle.net/Znarkus/m27CK/

Reproduced with jQuery UI 1.8.18

Changed October 11, 2012 02:49PM UTC by scottgonzalez comment:2

milestone: 1.9.02.0.0

Changed October 27, 2012 07:52PM UTC by mikesherov comment:3

status: newopen

confirmed on latest: http://jsfiddle.net/3ythc/

Changed October 27, 2012 07:54PM UTC by mikesherov comment:4

cc: → scott.gonzalez

Scott, even though I marked this as open, this might simply be a documentation issue. Should ui.position be constrained if there is a containment, or should it always track the mouse, and not the element?

Changed October 27, 2012 07:55PM UTC by mikesherov comment:5

summary: draggable with constrain axis option returns incorrect positionDraggable: constrained axis option returns incorrect position

Changed October 29, 2012 01:00AM UTC by scottgonzalez comment:6

ui.position should be the constrained value. Users are allowed to modify the value in order to implement custom constraints, which would affect the value in later event handlers; so there's no reason that built-in contraints shouldn't modify the value directly. However, there is a question of whether built-in constraints should run before or after user-bound event handlers.

Changed October 20, 2013 07:42PM UTC by mikesherov comment:7

#9188 is a duplicate of this ticket.

Changed October 20, 2013 07:42PM UTC by mikesherov comment:8

owner: → mikesherov
status: openassigned

Changed October 20, 2013 11:46PM UTC by Mike Sherov comment:9

resolution: → fixed
status: assignedclosed

Draggable: apply axis options to position instead of style. Fixes #7251 - Draggable: constrained axis option returns incorrect position.

Changeset: 94f8c4d5e9ef461973a504d65dd906c1120da71d

Changed October 20, 2013 11:49PM UTC by mikesherov comment:10

milestone: 2.0.01.11.0