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
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
var menuExpanded by remember { mutableStateOf(false) }
@@ -244,9 +244,11 @@ fun CardButton(cardInfo: CardInfo, onDeleteCard: (Int) -> Unit, reorderIcon: @Co
)
}
if (reorderIcon != null) {
reorderIcon()
}
}
}
DropdownMenu(
expanded = menuExpanded,
@@ -234,9 +234,9 @@ fun MainPage(
.fillMaxWidth()
.alpha(if (isDragging) 0.7f else 1f)
) {
CardButton(
card,
onDeleteCard,
var reorderIcon: (@Composable () -> Unit)? = null
if (queryCleaned.isEmpty()) {
reorderIcon = {
Icon(
imageVector = Icons.Outlined.DragHandle,
@@ -251,6 +251,12 @@ fun MainPage(
.padding(8.dp)
)
}
}
CardButton(
card,
onDeleteCard,
reorderIcon
)
}
}