Opened 5 years ago

Last modified 2 years ago

#8477 open bug

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/

Change History (5)

comment:1 Changed 5 years ago by scottgonzalez

  • Resolution set to invalid
  • Status changed from new to closed

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

comment:2 Changed 5 years ago by scottgonzalez

  • Resolution invalid deleted
  • Status changed from closed to reopened

Actually, I see what you mean.

comment:3 Changed 4 years ago by scottgonzalez

  • Milestone changed from 1.9.0 to 2.0.0

comment:4 Changed 4 years ago by mikesherov

  • Status changed from reopened to open

comment:5 Changed 2 years ago by mikesherov

  • Milestone changed from 2.0.0 to none

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.

Note: See TracTickets for help on using tickets.