Close grid item popup when item changes

Close #170
This commit is contained in:
MM20 2022-09-16 15:55:41 +02:00
parent f04f9be4b6
commit 4c8173360e
No known key found for this signature in database
GPG Key ID: 0B61A8F2DEAFA389

View File

@ -49,9 +49,10 @@ import kotlinx.coroutines.delay
@Composable
fun GridItem(modifier: Modifier = Modifier, item: Searchable, showLabels: Boolean = true) {
val viewModel = remember(item.key) { GridItemVM(item) }
val context = LocalContext.current
var showPopup by remember { mutableStateOf(false) }
var showPopup by remember(item.key) { mutableStateOf(false) }
var bounds by remember { mutableStateOf(Rect.Zero) }
Column(modifier = modifier, horizontalAlignment = Alignment.CenterHorizontally) {
val badge by remember(item.key) { viewModel.badge }.collectAsState(null)