Sortable icon indicating copy to clipboard operation
Sortable copied to clipboard

Ghost is mispositioned on touch devices when parent has transform property applied in CSS

Open NeosinneR opened this issue 12 years ago • 7 comments

This is caused because of bug in Chromium (https://code.google.com/p/chromium/issues/detail?id=20574), when position:fixed doesn't work if parent is transformed. Since sortable's ghost element is using position:fixed on touch devices, it is positioned wrongly.

To reproduce, just use example in index.html and add this to .block {} in CSS

-webkit-transform: translate(0, 0);
transform: translate(0, 0);

NeosinneR avatar Apr 08 '14 08:04 NeosinneR

@RubaXa any comments on this issue? Or better yet, accept pull request, please?

NeosinneR avatar May 13 '14 06:05 NeosinneR

Something I do not like this solution. Block can be not relative or absolute. It is therefore used fixed position.

RubaXa avatar May 14 '14 04:05 RubaXa

I'm experiencing this on Chrome 35/Firefox 30, too. Makes sense that this would be a general issue too.

Replacing the transform with top resolves the problem, but disables hardware acceleration. Unless I think of a workaround, I may pull request with another solution?

Thanks for Sortable.

dminkovsky avatar Jun 23 '14 23:06 dminkovsky

Sure.

RubaXa avatar Jun 24 '14 07:06 RubaXa

I had a similar ghost positioning issue with IOS and Android using Ionic. I tested the above fix in IOS but it didn't work because 'target' was undefined. Instead, I grabbed the event target and that seemed to work.

techntrails avatar Sep 04 '14 10:09 techntrails

@NeosinneR Your commit solved my issue, thanks.

designbyadrian avatar Mar 02 '15 16:03 designbyadrian

@techntrails I'm also having a problem using Sortable with Ionic, though in my case the item that's being dragged (not the ghost) is mispositioned. I'm wondering if Ionic's bar header is interfering with the calculation of the 'top' property on the draggable item? I haven't been able to find many examples of people using this with Ionic, was just wondering if you'd had this issue.

christophermiles avatar Jun 16 '15 07:06 christophermiles