Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TextField readOnly property changing makes it impossible to open the keyboard #2722

Closed
1 task
slartus opened this issue Feb 10, 2023 · 2 comments
Closed
1 task

Comments

@slartus
Copy link

slartus commented Feb 10, 2023

Describe the bug
changing the readonly value makes it impossible to open the keyboard

Affected platforms

  • Android

Versions

  • Kotlin version*: 1.8.0
  • Compose Multiplatform version*: 1.3.0

To Reproduce

var value by remember { mutableStateOf("1111") }
var readOnly by remember { mutableStateOf(false) }
val onValueChange: (String) -> Unit = remember { { value = it } }
val requester = remember { FocusRequester() }

TextField(
    modifier = Modifier.fillMaxWidth().focusRequester(requester),
    value = value,
    onValueChange = onValueChange,
    readOnly = readOnly
)
LaunchedEffect(Unit) {
    delay(300)
    requester.requestFocus()
    delay(1000)
    readOnly = true
    delay(1000)
    readOnly = false
    value = ""
    requester.requestFocus()
}
device-2023-02-10-080244.webm
igordmn added a commit that referenced this issue Feb 10, 2023
igordmn added a commit that referenced this issue Feb 10, 2023
@slartus
Copy link
Author

slartus commented Feb 10, 2023

the error is not reproduced in clear Android compose

@pjBooms
Copy link
Contributor

pjBooms commented Feb 10, 2023

the error is not reproduced in clear Android compose

Can you check your sample on Jetpack Compose UI 1.3.3 in clear Android Compose? Does not it have the same issue?

Please note that Compose Multiplatform 1.3.0 is based on Jetpack Compose UI 1.3.3 as stated here: https://github.com/JetBrains/compose-jb/releases

@pjBooms pjBooms closed this as not planned Won't fix, can't repro, duplicate, stale Feb 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants