Skip to main content

Search and Top Navigation

#10607 closed bug (plugin)

Opened September 15, 2014 08:40PM UTC

Closed September 15, 2014 08:55PM UTC

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.

Attachments (0)
Change History (1)

Changed September 15, 2014 08:55PM UTC by tj.vantoll comment:1

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.