Opened 11 years ago
Last modified 8 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 11 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:2 Changed 11 years ago by
Resolution: | invalid |
---|---|
Status: | closed → reopened |
Actually, I see what you mean.
comment:3 Changed 10 years ago by
Milestone: | 1.9.0 → 2.0.0 |
---|
comment:4 Changed 10 years ago by
Status: | reopened → open |
---|
comment:5 Changed 8 years ago by
Milestone: | 2.0.0 → 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.
I'm not sure why you would think that. Elements with
overflow: auto
are still:visible
, even though they're not in the viewport.