Updated on 2026-08-14
This commit is contained in:
parent
f6950cee54
commit
8d6bb9a56b
1 changed files with 13 additions and 2 deletions
|
|
@ -24,6 +24,7 @@ import androidx.compose.runtime.*
|
|||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.drawBehind
|
||||
import androidx.compose.ui.focus.onFocusChanged
|
||||
import androidx.compose.ui.geometry.*
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.graphics.Path
|
||||
|
|
@ -386,11 +387,13 @@ private inline fun BaseScaffoldWithMarkets(
|
|||
LocalMainBottomSheetColor provides remember { mutableStateOf(backgroundPrimary) },
|
||||
) {
|
||||
val backgroundColor = LocalMainBottomSheetColor.current
|
||||
var isSearchFieldFocused by remember { mutableStateOf(false) }
|
||||
|
||||
BottomSheetStateEffects(
|
||||
bottomSheetState = bottomSheetState,
|
||||
alertConfig = alertConfig,
|
||||
onBottomSheetStateChange = onBottomSheetStateChange,
|
||||
isSearchFieldFocused = isSearchFieldFocused,
|
||||
)
|
||||
|
||||
TangemBottomSheetScaffold(
|
||||
|
|
@ -422,7 +425,14 @@ private inline fun BaseScaffoldWithMarkets(
|
|||
modifier = Modifier.sizeIn(maxHeight = maxHeight - statusBarHeight),
|
||||
) {
|
||||
Hand(Modifier.drawBehind { drawRect(backgroundColor.value) })
|
||||
bottomSheetContent()
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.onFocusChanged {
|
||||
isSearchFieldFocused = it.isFocused
|
||||
},
|
||||
) {
|
||||
bottomSheetContent()
|
||||
}
|
||||
}
|
||||
},
|
||||
content = { paddingValues ->
|
||||
|
|
@ -640,6 +650,7 @@ private fun BottomSheetStateEffects(
|
|||
bottomSheetState: TangemSheetState,
|
||||
alertConfig: WalletAlertState?,
|
||||
onBottomSheetStateChange: (BottomSheetState) -> Unit,
|
||||
isSearchFieldFocused: Boolean,
|
||||
) {
|
||||
val systemUiController = rememberSystemUiController()
|
||||
val navigationBarColor = TangemTheme.colors.background.primary
|
||||
|
|
@ -688,7 +699,7 @@ private fun BottomSheetStateEffects(
|
|||
val isKeyboardVisible by rememberIsKeyboardVisible()
|
||||
|
||||
LaunchedEffect(isKeyboardVisible) {
|
||||
if (isKeyboardVisible && alertConfig == null) {
|
||||
if (isKeyboardVisible && alertConfig == null && isSearchFieldFocused) {
|
||||
bottomSheetState.expand()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue