Skip to content

Animation doesn't show some items moving if you release too quickly #117

Description

@Blackilykat

If while moving an item you release quickly enough, some items which should get moved down or up are not animated and only snap into their position once the list is updated with onSettle.

issue.mp4

The example video uses a ReorderableColumn (full context):

ReorderableColumn(
    list = filters,
    onSettle = { from, to ->
        Library.moveFilter(ClientStorage.MAIN.filters!!.get(from), to)
    },
) { _, item, _ ->
    key(item.id) {
        ReorderableItem {
            Surface(
                modifier = Modifier
                    .fillMaxWidth()
                    .height(50.dp)
                    .draggableHandle()
                    .padding(5.dp)
                    .clip(RoundedCornerShape(5.dp))
            ) {
                Row(
                    modifier = Modifier.fillMaxHeight(),
                    verticalAlignment = Alignment.CenterVertically
                ) {
                    Icon(
                        painterResource(R.drawable.drag_horizontal_variant),
                        "Reorder",
                        modifier = Modifier.size(30.dp).padding(end = 5.dp, start = 5.dp),
                    )
                    Text(item.key)
                }
            }
        }
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions