Closed ankur2136 closed 1 year ago
Were you able to repro using LaunchedEffect per https://stackoverflow.com/questions/74184416/search-focusrequester-is-not-initialized/77250333 ?
val coroutineScope = rememberCoroutineScope()
OutlinedTextField(
...
modifier = modifier
.....
.autofill(
autofillTypes = listOf(AutofillType.PhoneNumberNational),
onFill = { filledPhoneNumber ->
...
keyboardController?.hide()
// https://github.com/jump-sdk/jetpack_compose_country_code_picker_emoji/issues/42
coroutineScope.launch {
focusRequester.freeFocus()
}
},
focusRequester = focusRequester,
)
.focusRequester(focusRequester = focusRequester),
...
},
Tested a fix where wrapping the freeFocus inside a coroutineScope fixes this issue.
Describe the bug Crash on autofill phone number
To Reproduce Steps to reproduce the behavior: I can consistently repro on v2.2.2 However this doesn't crash on the first autofill.
Note that if I manually type in the phone number and press done on the keyboard, it doesn't crash. both code paths do the same thing
focusRequester.freeFocus()
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context