Hello Everyone, I need help. I want to hide the bo...
# android
f
Hello Everyone, I need help. I want to hide the bottom sheet when the keyboard opens, but currently, the bottom sheet opens along with the keyboard. Please help me fix this issue. Here is my codebase: I don't want to use sheetPeekHeight.
Copy code
val scaffoldState = rememberBottomSheetScaffoldState(
        bottomSheetState = SheetState(
            skipPartiallyExpanded = false,
            density = LocalDensity.current, initialValue = SheetValue.PartiallyExpanded,
            skipHiddenState = true
        )
    )

    val isKeyboardOpen = rememberIsKeyboardOpen().value
    val pricingDataExists = pricingData.value != null
    val targetHeight = if (isKeyboardOpen || !pricingDataExists) 0.dp else 163.dp

    val animateHeight by animateDpAsState(
        targetValue = targetHeight,
        animationSpec = tween(
            durationMillis = 100,
            easing = LinearOutSlowInEasing
        ), label = ""
    )


    BottomSheetScaffold(
        scaffoldState = scaffoldState,
        modifier = Modifier.fillMaxSize(),
        sheetContent = {
            RegistrationBottomSheetContent(navigator, pricingData.value)
        },
        sheetTonalElevation = 30.dp,
        sheetPeekHeight = 163.dp,
        sheetContainerColor = sheetContainerColor,
        sheetContentColor = MaterialTheme.colorScheme.onSurface,
        containerColor = MaterialTheme.colorScheme.surface,
        sheetShadowElevation = 10.dp,
        sheetDragHandle = {
            Box(
                modifier = Modifier
                    .fillMaxWidth()
                    .height(32.dp)
                    .background(MaterialTheme.colorScheme.surface),
                contentAlignment = Alignment.Center
            ) {
                Box(
                    modifier = Modifier
                        .width(98.dp)
                        .height(4.dp)
                        .background(HeyJomGrey, CircleShape)
                )
            }
        },
        sheetSwipeEnabled = true
    ) {
        RegistrationFormContent(
            navigator = navigator,
            eventRegiViewModel = eventRegiViewModel
        )
    }
🧵 1