aclassen / ComposeReorderable

Enables reordering by drag and drop in Jetpack Compose (Desktop) LazyList & LazyGrid.
Apache License 2.0
821 stars 86 forks source link

Keyboard is hiding while writing text in TextInput, which is located in ReorderableItem #212

Closed Lime-blur closed 1 year ago

Lime-blur commented 1 year ago

Keyboard is hiding while writing text in TextInput, which is located in ReorderableItem. I noticed that it happens due to:

items(
    items = data.value,
    key = { it } // Problem here
) { ... }
Lime-blur commented 1 year ago

Fixed. You must use:

items(
    items = data.value,
    key = { it.anyField }
) { item ->
    ReorderableItem(reorderableState = scrollState, key = currentItem.anyField) { ... }
}