Sortable: Ghost element constrained to source container when overflow:auto on iOS

Created on 19 Oct 2019  路  3Comments  路  Source: SortableJS/Sortable

Problem:

When dragging items between containers on iOS, if the source container is overflow:auto and it (or a parent) is position relative or absolute, the dragged ghost element is trapped within its container. It appears to make the the container bigger, based on the container's changing scrollbars.

Tested on SortableJS 1.10.1.

It looks like iOS forces PositionGhostAbsolutely to be set to true, which uses absolute instead of fixed positioning for the ghost element. Presumably this is due to older versions of iOS Safari not supporting fixed positioning. Disabling this feature (i.e. forcing PositionGhostAbsolutely to false) appears to fix the issue.

A setting such as forceFixedPositioning to override the default iOS behaviour would be helpful. I'm willing to create a patch for this.

JSBin/JSFiddle demonstrating the problem:

http://jsfiddle.net/tL6rq128/5/embedded/result

Most helpful comment

@jkrasnay Try setting the option fallbackOnBody: true.

All 3 comments

This issue may also be compounded by #1673.

@jkrasnay Try setting the option fallbackOnBody: true.

fallbackOnBody:true works perfectly, and nicely sidesteps #1673 as well. Thanks, @owen-m1 !

Was this page helpful?
0 / 5 - 0 ratings

Related issues

irfanlone picture irfanlone  路  3Comments

graemegeorge picture graemegeorge  路  4Comments

geonanorch picture geonanorch  路  3Comments

artaommahe picture artaommahe  路  4Comments

garygreen picture garygreen  路  3Comments