Updated on 2026-08-14

This commit is contained in:
Tangem 2023-11-01 21:49:09 +08:00
parent 44343a08a0
commit 7ad1d1cecf
2 changed files with 13 additions and 4 deletions

View file

@ -36,6 +36,8 @@ import com.tangem.tap.features.tokens.impl.presentation.states.TokenItemState
import com.tangem.tap.features.tokens.impl.presentation.states.TokensListStateHolder
import com.tangem.tap.features.tokens.impl.presentation.states.TokensListToolbarState
import com.tangem.wallet.R
import kotlinx.coroutines.flow.collectLatest
import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.flow.emptyFlow
import kotlinx.coroutines.flow.flowOf
@ -114,12 +116,9 @@ private fun TokensListContent(
) {
val state = rememberLazyListState()
if (state.isScrollInProgress) {
LocalSoftwareKeyboardController.current?.hide()
}
LazyColumn(
modifier = Modifier
.imePadding()
.fillMaxSize()
.padding(scaffoldPadding),
state = state,
@ -139,6 +138,13 @@ private fun TokensListContent(
TokenItem(model = it)
}
}
val keyboardController = LocalSoftwareKeyboardController.current
LaunchedEffect(key1 = state) {
snapshotFlow(state::isScrollInProgress)
.distinctUntilChanged()
.collectLatest { if (it) keyboardController?.hide() }
}
}
@Composable