Opened 10 years ago
Last modified 10 years ago
#9460 open bug
Sortable: containment doesn't work properly when scrolling
Reported by: | omegak | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | none |
Component: | ui.sortable | Version: | 1.10.3 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
In a sortable component, the containment works just fine when the container (overflow: auto) is not scrolling. However, when it does, if an item is dragged to the bottom the containment stops working as expected. The item moves then beyond the height of the container until its scrollHeight.
This jsFiddle shows both cases, with and without scrolling, and can be clearly seen how the sortable item is contained at scrollHeight.
Change History (4)
comment:1 Changed 10 years ago by
Status: | new → open |
---|---|
Summary: | Sortable containment doesn't work properly when scrolling → Sortable: containment doesn't work properly when scrolling |
comment:2 follow-up: 3 Changed 10 years ago by
@tj
overflow-y: visible|hidden|scroll|auto|no-display|no-content;
looking at the code looks like that the height is always scrollHeight . Am i missing something ?
over = ($(ce).css("overflow") !== "hidden"); if co.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight)
comment:3 Changed 10 years ago by
Replying to dekajp:
@tj
overflow-y: visible|hidden|scroll|auto|no-display|no-content;
looking at the code looks like that the height is always scrollHeight . Am i missing something ?
over = ($(ce).css("overflow") !== "hidden"); if co.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight)
There's a lot of black magic going on in that portion of sortable. That code in particular is calculating some containment values to be used later. I wouldn't be able to say more without really digging into this.
comment:4 Changed 10 years ago by
PR (incomplete , lacking unit test cases & closed) -> https://github.com/jquery/jquery-ui/pull/1139
Reduced and updated to the latest version: http://jsfiddle.net/tj_vantoll/2bHSG/6/.