Chris Johnson
03/03/2022, 12:07 AMChris Johnson
03/03/2022, 12:10 AMModifier.weight(.8f)
.onFocusChanged {
if (isFocused) {
onSearchBarFocused()
}
}.focusable(enabled = !isLoading, interactionSource = interactionSource)
and I get this error
java.lang.IllegalStateException: Compose Runtime internal error. Unexpected or incorrect use of the Compose internal runtime API (Use active SlotWriter to determine anchor location instead). Please report to Google or use <https://goo.gle/compose-feedback>
When trying to focus my TextField when it's done loading.
My use case is I don't want to allow focus on my TextField until data has finished loading and at that point they can click into it and start typing.
isLoading is a boolean on my uiState that gets changed in the viewModel.
To me the above seems pretty intuitive. If we're not loading, then listen for isFocused changes and respond. I guess it gets tripped up when isLoading
is true but you try to focus the TextField. That's when I get the crash. Is there a better way to do this?Chuck Jazdzewski [G]
03/03/2022, 12:48 AMChuck Jazdzewski [G]
03/03/2022, 12:50 AMChris Johnson
03/03/2022, 12:51 AMChris Johnson
03/23/2022, 8:12 PM