Skip to main content

Search and Top Navigation

#8477 open bug ()

Opened August 07, 2012 10:20PM UTC

Last modified August 27, 2014 01:44PM UTC

Draggable - overflow: auto - non-visible elements involved in snapping

Reported by: jamesc Owned by:
Priority: minor Milestone: none
Component: ui.draggable Version: 1.8.21
Keywords: Cc:
Blocked by: Blocking:
Description

jsFiddle: http://jsfiddle.net/tr00st/A43X5/1/

jsFiddle w/ workaround: http://jsfiddle.net/tr00st/95BM7/1/

When using draggable snapped to targets within a div that's set to "overflow: auto" (or presumably hidden - untested), the draggable will snap to targets even when they're not shown on the page - ie: they're outside the "visible" portion of the div. I'd expect that the snapping behaviour would only occur when interacting with visible elements.

Found in 1.8.21 (latest google CDN version at the moment)

OS: Win7 x64

Browser: Chrome 21.0 (plus FF/IE/Opera - presumed universal)

To reproduce:

  • Load jsFiddle - http://jsfiddle.net/tr00st/A43X5/1/
  • Drag div labelled "Drag me" down under the scrollable div
  • The draggable will snap onto invisible elements (hidden by the overflow rule)

For the sake of completeness, I've put together a temporary workaround for the issue - struggled deciphering the snapping code at this point, so it's just in a jsFiddle: http://jsfiddle.net/tr00st/95BM7/1/

Attachments (0)
Change History (5)

Changed August 07, 2012 10:21PM UTC by scottgonzalez comment:1

resolution: → invalid
status: newclosed

I'm not sure why you would think that. Elements with overflow: auto are still :visible, even though they're not in the viewport.

Changed August 07, 2012 10:23PM UTC by scottgonzalez comment:2

resolution: invalid
status: closedreopened

Actually, I see what you mean.

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

milestone: 1.9.02.0.0

Changed October 27, 2012 08:19PM UTC by mikesherov comment:4

status: reopenedopen

Changed August 27, 2014 01:44PM UTC by mikesherov comment:5

milestone: 2.0.0none

This bug is a great example of why snap is being deprecated in 2.0. Alas, I suppose someone *could* fix this by constraining each snapElement to the dimensions of its scrollParent, which is more generic than the patch linked above.

Sigh.

I'm not going to work on it for now though, and it definitely won't be fixed in 2.0 unless you consider removal fixing.