Sortable: `transform: translateZ(0px)` is left on the dragged item when the list doesn't change

Created on 18 Nov 2019  路  3Comments  路  Source: SortableJS/Sortable

Problem:

When initiating a drag, but not changing the order of elements, a transform: translateZ(0px); is left on the element. This can cause issues with styling, especially in tables. It should be removed as it is when the an element changes position.

JSBin/JSFiddle demonstrating the problem:

jsbin.com (draft)

Most helpful comment

I have the same issue.
In my case translateZ style breaks bootstrap modal nested inside draggable item.

i used onEnd callback to fix this:

new Sortable(el, {
    onEnd: (e) =>   e.item.style.transform = null
})

All 3 comments

An issue for us as well. Trying to find way to remove in events. It's causing problems with z-index with our table rows.

I have the same issue.
In my case translateZ style breaks bootstrap modal nested inside draggable item.

i used onEnd callback to fix this:

new Sortable(el, {
    onEnd: (e) =>   e.item.style.transform = null
})

This was solved in commit e97937010a112b4550b613e47f9e0019624d827d. I will release a new version soon.

Was this page helpful?
0 / 5 - 0 ratings