MohamedRejeb/compose-dnd

Wrong Z-index.

Closed this issue · 2 comments

Hello. You have a nice library out here!

I found a problem.

When I drag my item I want it to be animated non active status to active status and then stared to drag. I am doing this by empty draggableContent. By the drag became with wrong z-index. See the video. Active item goes under non active item. I believe this is wrong.

ReorderableItem(
        modifier = modifier,
        state = reorderState,
        key = text,
        data = text,
        onDrop = {},
        onDragEnter = onDragEnter,
        draggableContent = {} <- empty
    ) {...}
vidma_recorder_09072024_134831.mp4

Hi, Thanks.

The draggableContent needs to be set to have a correct z-index because it's going to be used to draw the DraggableItem shadow on top of everything.
If a bit of delay before user can start dragging, what about trying rememberReorderState(dragAfterLongPress = true).
Also why you didn't try to make the animation with the draggableContent? And you can hide the original item when you are dragging using the isDragging property

Feel free to reopen, if you still have an issue.