Skip to content

Commit

Permalink
fix: ensure request focus is called once after the first composition …
Browse files Browse the repository at this point in the history
…is done [WPB-10571] 🍒 (#3324)

Co-authored-by: Mohamad Jaara <[email protected]>
Co-authored-by: Yamil Medina <[email protected]>
  • Loading branch information
3 people authored Aug 14, 2024
1 parent 25e4ff2 commit 8d14713
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,11 @@ private fun CodeContent(
}
Spacer(modifier = Modifier.weight(1f))
}
}
LaunchedEffect(Unit) {
coroutineContext.job.invokeOnCompletion {
focusRequester.requestFocus()
keyboardController?.show()
LaunchedEffect(Unit) {
coroutineContext.job.invokeOnCompletion {
focusRequester.requestFocus()
keyboardController?.show()
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ import com.wire.kalium.logic.configuration.server.ServerConfig
@WireDestination(navArgsDelegate = CreateAccountNavArgs::class)
@Composable
fun CreateAccountEmailScreen(
createAccountEmailViewModel: CreateAccountEmailViewModel = hiltViewModel(),
navigator: Navigator
navigator: Navigator,
createAccountEmailViewModel: CreateAccountEmailViewModel = hiltViewModel()
) {
with(createAccountEmailViewModel) {
fun navigateToDetailsScreen() = navigator.navigate(
Expand Down Expand Up @@ -185,6 +185,9 @@ private fun EmailContent(
}
Spacer(modifier = Modifier.weight(1f))
EmailFooter(state = state, onLoginPressed = onLoginPressed, onContinuePressed = onContinuePressed)
LaunchedEffect(Unit) {
focusRequester.requestFocus()
}
}
}
if (state.termsDialogVisible) {
Expand All @@ -198,9 +201,6 @@ private fun EmailContent(
if (state.error is CreateAccountEmailViewState.EmailError.DialogError.GenericError) {
CoreFailureErrorDialog(state.error.coreFailure, onErrorDismiss)
}
LaunchedEffect(Unit) {
focusRequester.requestFocus()
}
}

@Composable
Expand Down

0 comments on commit 8d14713

Please sign in to comment.