You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If my keyboard is opened, then on clicking of button if i try to hide my keyboard and change sheetState to show() then my keyboard hides but my sheet is not visible.
Mimicing opening of sheetState on result from api call.
Note - Sheet is shown for first time only. Its also working fine on emulator on Api level 33 but not below that Note - If using preview then its working fine, but if using it inside fragment then its not working
Link to StackOverflow - https://stackoverflow.com/questions/74958610/bottom-sheet-not-being-shown-if-hiding-keyboard?noredirect=1#comment132284233_74958610 setContent { val sheetState = rememberModalBottomSheetState(ModalBottomSheetValue.Hidden) val key = LocalSoftwareKeyboardController.current ModalBottomSheetLayout( sheetState = sheetState, sheetContent = { repeat(20) { Text(text = "$it") } } ) { Column { var otpResponse by remember { mutableStateOf<Boolean?>(null) } if (otpResponse == false) { LaunchedEffect(key1 = Unit, block = { delay(180) otpResponse = true }) } if (otpResponse == true) { LaunchedEffect(key1 = Unit, block = { sheetState.show() }) } Column { var string by remember { mutableStateOf("") } TextField(value = string, onValueChange = { string = it }) Button(onClick = { key?.hide() otpResponse = false }) { Text(text = "TEST") } } } } }
The text was updated successfully, but these errors were encountered:
sarthak-paytail
changed the title
ModalBottomSheetLayout not opening when closing the keyboard simultaneaously
ModalBottomSheetLayout not opening when closing the keyboard simultaneaously inside Fragment
Jan 8, 2023
If my keyboard is opened, then on clicking of button if i try to hide my keyboard and change sheetState to show() then my keyboard hides but my sheet is not visible.
Mimicing opening of sheetState on result from api call.
Note - Sheet is shown for first time only. Its also working fine on emulator on Api level 33 but not below that
Note - If using preview then its working fine, but if using it inside fragment then its not working
Link to StackOverflow - https://stackoverflow.com/questions/74958610/bottom-sheet-not-being-shown-if-hiding-keyboard?noredirect=1#comment132284233_74958610
setContent { val sheetState = rememberModalBottomSheetState(ModalBottomSheetValue.Hidden) val key = LocalSoftwareKeyboardController.current ModalBottomSheetLayout( sheetState = sheetState, sheetContent = { repeat(20) { Text(text = "$it") } } ) { Column { var otpResponse by remember { mutableStateOf<Boolean?>(null) } if (otpResponse == false) { LaunchedEffect(key1 = Unit, block = { delay(180) otpResponse = true }) } if (otpResponse == true) { LaunchedEffect(key1 = Unit, block = { sheetState.show() }) } Column { var string by remember { mutableStateOf("") } TextField(value = string, onValueChange = { string = it }) Button(onClick = { key?.hide() otpResponse = false }) { Text(text = "TEST") } } } } }
The text was updated successfully, but these errors were encountered: