diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/helpers/ModalView.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/helpers/ModalView.kt index 3655c4053d..00a3db992f 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/helpers/ModalView.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/helpers/ModalView.kt @@ -9,6 +9,7 @@ import androidx.compose.runtime.* import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color +import androidx.compose.ui.input.pointer.pointerInput import chat.simplex.common.model.ChatController.appPrefs import chat.simplex.common.platform.* import LocalCardScreen @@ -224,6 +225,10 @@ class ModalManager(private val placement: ModalPlacement? = null) { if (toRemove.isNotEmpty() && it == modalCount.value && transition.currentState == EnterExitState.Visible && !transition.isRunning) { runAtomically { toRemove.removeIf { elem -> modalViews.removeAt(elem); true } } } + // Until the opening modal covers the page that opened it, or the view under the first modal, a second click there would open it again + if (transition.targetState == EnterExitState.PostExit && it < modalCount.value) { + Box(Modifier.fillMaxSize().pointerInput(Unit) {}) + } } }