Opened 6 years ago

Closed 3 years ago

Last modified 3 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: 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

Change History (10)

comment:1 Changed 5 years ago by znarkus

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

Reproduced with jQuery UI 1.8.18

Last edited 5 years ago by znarkus (previous) (diff)

comment:2 Changed 4 years ago by scottgonzalez

  • Milestone changed from 1.9.0 to 2.0.0

comment:3 Changed 4 years ago by mikesherov

  • Status changed from new to open

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

comment:4 Changed 4 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 4 years ago by mikesherov

  • Summary changed from draggable with constrain axis option returns incorrect position to Draggable: constrained axis option returns incorrect position

comment:6 Changed 4 years ago by scottgonzalez

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 3 years ago by mikesherov

#9188 is a duplicate of this ticket.

comment:8 Changed 3 years ago by mikesherov

  • Owner set to mikesherov
  • Status changed from open to assigned

comment:9 Changed 3 years ago by Mike Sherov

  • Resolution set to fixed
  • Status changed from assigned to closed

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

Changeset: 94f8c4d5e9ef461973a504d65dd906c1120da71d

comment:10 Changed 3 years ago by mikesherov

  • Milestone changed from 2.0.0 to 1.11.0
Note: See TracTickets for help on using tickets.