Fix page re-ordering (was broken by 3c68e08)

This commit is contained in:
Pierre-Yves Nicolas
2026-01-18 07:46:16 +01:00
parent 8951218cb4
commit c531bd35c5

View File

@@ -72,7 +72,8 @@ fun CommonPageList(
val isLandscape = LocalConfiguration.current.orientation == Configuration.ORIENTATION_LANDSCAPE val isLandscape = LocalConfiguration.current.orientation == Configuration.ORIENTATION_LANDSCAPE
val reorderableLazyListState = rememberReorderableLazyListState(state.listState) { from, to -> val reorderableLazyListState = rememberReorderableLazyListState(state.listState) { from, to ->
state.onPageReorder(from.key as String, to.index) val pageId = state.document.pageKeys[from.index].pageId
state.onPageReorder(pageId, to.index)
} }
val content: LazyListScope.() -> Unit = { val content: LazyListScope.() -> Unit = {
itemsIndexed(state.document.pageKeys, key = { _, item -> item.saveKey}) { index, item -> itemsIndexed(state.document.pageKeys, key = { _, item -> item.saveKey}) { index, item ->