Opened 9 years ago

Closed 9 years ago

#10607 closed bug (plugin)

snapTolerance not being taken into consideration if the snappable objects are hidden and shown during drag event

Reported by: msqar Owned by:
Priority: minor Milestone: none
Component: ui.draggable Version: 1.11.1
Keywords: Cc:
Blocked by: Blocking:

Description

So I'm trying to make an element snap to some guide-lines on the document, but they are always hidden, only when you start dragging the element, they show up and then I would like the element to snap to those lines... but draggable doesn't seem to care much about those guide-lines that were hidden before start dragging.

I made this JSFiddle so you can see what I'm talking about.

http://jsfiddle.net/cLs7mq4p/1/

Start dragging and stop... then drag again to try to make it snap to the lines that were hidden.

Change History (1)

comment:1 Changed 9 years ago by tj.vantoll

Component: ui.coreui.draggable
Resolution: plugin
Status: newclosed

Hi msqar,

Thanks for taking the time to contribute to jQuery UI You can get the behavior you're looking for by using a mousedown listener so that the showing/hiding occurs before draggable's snap logic runs: http://jsfiddle.net/tj_vantoll/cLs7mq4p/2/.

This isn't something we intend to add support for in the library as the snap option is not being preserved in the draggable widget rewrite. Also this behavioris something no one has asked for before.

Note: See TracTickets for help on using tickets.