Opened 12 years ago

Closed 10 years ago

Last modified 10 years ago

#7251 closed bug (fixed)

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: Scott González
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

Change History (10)

comment:1 Changed 11 years ago by znarkus

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

Version 0, edited 11 years ago by znarkus (next)

comment:2 Changed 11 years ago by Scott González

Milestone: 1.9.02.0.0

comment:3 Changed 11 years ago by mikesherov

Status: newopen

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

comment:4 Changed 11 years ago by mikesherov

Cc: scott.gonzalez added

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?

comment:5 Changed 11 years ago by mikesherov

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

comment:6 Changed 11 years ago by Scott González

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.

comment:7 Changed 10 years ago by mikesherov

#9188 is a duplicate of this ticket.

comment:8 Changed 10 years ago by mikesherov

Owner: set to mikesherov
Status: openassigned

comment:9 Changed 10 years ago by Mike Sherov

Resolution: fixed
Status: assignedclosed

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

Changeset: 94f8c4d5e9ef461973a504d65dd906c1120da71d

comment:10 Changed 10 years ago by mikesherov

Milestone: 2.0.01.11.0
Note: See TracTickets for help on using tickets.