Iscle
Iscle

Reputation: 829

Jetpack Compose OutlinedTextView not opening keyboard after back press

I'm building an Android application with Jetpack Compose and the latest version (at the time) of material3 components.

implementation("androidx.compose.material3:material3:1.2.0-beta01")

Everything works nicely but for some reason, the OutlinedTextView only opens the keyboard when getting focus for the first time. If I close the keyboard by using the back button it won't reopen when tapping the OutlinedTextView again.

Has somebody seen this issue before? If so, what's the way to fix it?

The code for the view is the following

    OutlinedTextField(
        value = text,
        onValueChange = { text = it },
        modifier = Modifier
            .fillMaxWidth()
            .padding(horizontal = 16.dp),
        label = {
            Text("Search")
        }
    )

Upvotes: 0

Views: 449

Answers (2)

Priyanshu Raj
Priyanshu Raj

Reputation: 33

now they have a fix for this just upgrade this lib to latest its something like

implementation ("androidx.compose.material3:material3:1.2.0-rc01")

Upvotes: 0

Iscle
Iscle

Reputation: 829

Turns out this is a bug with the material3 components library happening from version alpha12.

Rolling back to alpha11 fixes the issue.

Source: https://issuetracker.google.com/issues/317641563

Upvotes: 0

Related Questions