I get an exception here about FocusRequester not b...
# compose
o
I get an exception here about FocusRequester not being initialized
Copy code
val passwordRequester = remember { FocusRequester() }

        Card(
            modifier = Modifier
                .fillMaxWidth()
                .padding(horizontal = 32.dp),
            elevation = 4.dp
        ) {
            Column(
                modifier = Modifier.padding(16.dp),
                horizontalAlignment = Alignment.CenterHorizontally
            ) {
                EmailInput(
                    modifier = Modifier.fillMaxWidth(),
                    email = email,
                    onEmailChanged = onEmailChanged
                ) {
                     // HERE
                    passwordRequester.requestFocus()
                }

                Spacer(modifier = Modifier.height(16.dp))

                PasswordInput(
                    modifier = Modifier.focusRequester(passwordRequester),
                    password = password,
                    onPasswordChanged = onPasswordChanged,
                    onDoneClicked = onAuthenticate
                )
            }
        }
o
Could you try to move the requester in the same scope where it is used? In this case inside the Column.
242 Views