Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Attachment actions
Unintended behavior
View staffing
Description
Jetpack Compose component used: Material3, BasicTextField, SelectionContainer, DisableSelection
Android Studio Build: Build #AI-233.14808.21.2331.11709847, built on April 12, 202
Kotlin version: 1.9.23
Steps to Reproduce:
1. Create a project and a screen with a TextField, or OutlinedTextField, or BasicTextfield
2. Set TextField to enabled = false, readonly = true,
3. Long press on the text inside the textfield
4. Click outside of the textfield
5. Add a SelectionContainer {} then add a Text() inside of it
6. LongPress on that text
7. Click outside of that text
Expected behavior:
Either the textfield does not allow text selection when its disabled and/or readonly, or the text selection should disappear when clicking outside the textfield. Unfortunately the textfield does not get focused, so manually manipulating the selection when losing focus is not something that would work in this scenario.
Actual behavior:
User can select/highlight text, and the highlight/selection does not disappear until user clicks on Copy. It stays highlighted even after recompositions.
DisableSelection {} does not work either.
I attached a mini-project that can be used to reproduce the issue. Also attached a screenshow about the problem.