Skip to content

ReorderableItem content should be placed in a Column to match LazyListScope #101

@marcardar

Description

@marcardar

When using LazyListScope.items the content is laid out in a Column. However, with ReoderableItem the content is laid out in a Box. To work around this I do:

@Composable
fun LazyItemScope.ReorderableItemColumn(
    state: ReorderableLazyListState,
    key: Any,
    modifier: Modifier = Modifier,
    enabled: Boolean = true,
    animateItemModifier: Modifier = Modifier.animateItem(),
    content: @Composable ReorderableCollectionItemScope.(isDragging: Boolean) -> Unit,
) {
    ReorderableItem(
        state = state,
        key = key,
        modifier = modifier,
        enabled = enabled,
        animateItemModifier = animateItemModifier,
        content = { isDragging ->
            Column {
                content(isDragging)
            }
        }
    )
}

Perhaps changing this to a Column instead of Box fixes it?

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