Skip to main content

Search and Top Navigation

#9460 open bug ()

Opened July 26, 2013 10:09AM UTC

Last modified February 02, 2014 10:54PM UTC

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.

Attachments (0)
Change History (4)

Changed July 26, 2013 08:33PM UTC by tj.vantoll comment:1

status: newopen
summary: Sortable containment doesn't work properly when scrollingSortable: containment doesn't work properly when scrolling

Reduced and updated to the latest version: http://jsfiddle.net/tj_vantoll/2bHSG/6/.

Changed August 13, 2013 03:47AM UTC by dekajp comment:2

@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)

Changed August 14, 2013 01:16PM UTC by tj.vantoll comment:3

Replying to [comment:2 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.

Changed February 02, 2014 10:54PM UTC by dekajp comment:4

_comment0: PR (incomplete , lacking unit test cases) -> https://github.com/jquery/jquery-ui/pull/11391391381770165497

PR (incomplete , lacking unit test cases & closed) -> https://github.com/jquery/jquery-ui/pull/1139