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
I've tried a few things, but really what I'm looking to do is capture the state of my composable when the keyboard is open:
@Composable
fun MyComposable(autoFocus: Boolean) {
val focusRequester = remember { FocusRequester() }
LaunchedEffect("auto-focus") {
if (autoFocus) {
focusRequester.requestFocus()
}
}
TextField(
modifier = Modifier.focusRequester(focusRequester)
// other details here
)
}
// test implementation
@Test
fun keyboardOpen() {
val composable: @Composable () -> Unit = {
Column(modifier = Modifier.fillMaxSize()) {
MyComposable(true)
}
}
// ?? how to get it to capture the keyboard being open?
paparazzi.snapshot {
composable()
}
}
Every time I capture the screenshot I see the cursor in the png, but the keyboard is still shown as hidden. Any ideas on how to capture this state?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I've tried a few things, but really what I'm looking to do is capture the state of my composable when the keyboard is open:
Every time I capture the screenshot I see the cursor in the png, but the keyboard is still shown as hidden. Any ideas on how to capture this state?
Beta Was this translation helpful? Give feedback.
All reactions