I'm encountering a bit of a change between compose...
# compose
s
I'm encountering a bit of a change between compose 1.0 and 1.1. I believe the 1.0 behavior was correct, but maybe someone can clarify. On one screen, I have:
Copy code
@Composable
fun ScreenXContent() {
    val focusRequester = remember { FocusRequester() }
    TextField(
        modifier = Modifier.focusRequester(focusRequester),
        ...
    )
    LaunchedEffect(Unit) {
        focusRequester.requestFocus()
        focusRequester.captureFocus()
    }
}
When the user navigates away from that screen: in compose 1.0, the focus is freed and can be requested by something else; in compose 1.1, the focus is not freed and all subsequent focus requests fail. Should I be using a disposable effect to free the focus?
1
z
@Ralston Da Silva if a node that has captured focus leaves the composition, shouldn’t the capture be released?