fix: disabled changing position when cards searching

This commit is contained in:
2026-06-25 12:34:47 +03:00
parent 20a62b77b6
commit 8f79b60399
2 changed files with 13 additions and 5 deletions
@@ -186,7 +186,7 @@ fun TopBar(
} }
@Composable @Composable
fun CardButton(cardInfo: CardInfo, onDeleteCard: (Int) -> Unit, reorderIcon: @Composable () -> Unit) { fun CardButton(cardInfo: CardInfo, onDeleteCard: (Int) -> Unit, reorderIcon: (@Composable () -> Unit)? = null) {
val context = LocalContext.current val context = LocalContext.current
var menuExpanded by remember { mutableStateOf(false) } var menuExpanded by remember { mutableStateOf(false) }
@@ -244,9 +244,11 @@ fun CardButton(cardInfo: CardInfo, onDeleteCard: (Int) -> Unit, reorderIcon: @Co
) )
} }
if (reorderIcon != null) {
reorderIcon() reorderIcon()
} }
} }
}
DropdownMenu( DropdownMenu(
expanded = menuExpanded, expanded = menuExpanded,
@@ -234,9 +234,9 @@ fun MainPage(
.fillMaxWidth() .fillMaxWidth()
.alpha(if (isDragging) 0.7f else 1f) .alpha(if (isDragging) 0.7f else 1f)
) { ) {
CardButton( var reorderIcon: (@Composable () -> Unit)? = null
card,
onDeleteCard, if (queryCleaned.isEmpty()) {
reorderIcon = { reorderIcon = {
Icon( Icon(
imageVector = Icons.Outlined.DragHandle, imageVector = Icons.Outlined.DragHandle,
@@ -251,6 +251,12 @@ fun MainPage(
.padding(8.dp) .padding(8.dp)
) )
} }
}
CardButton(
card,
onDeleteCard,
reorderIcon
) )
} }
} }