https://kotlinlang.org logo
#compose
Title
# compose
t

theapache64

01/29/2022, 1:13 PM
How do I disable the bubble? 🤔 Usecase: I’ve a single digit OTP input field and it doesn’t need that
plus1 4
b

brandonmcansh

01/29/2022, 5:02 PM
Also related question, what color in TextFieldDefaults drive it's color?
t

theapache64

01/29/2022, 9:46 PM
+ @Zach Klippenstein (he/him) [MOD]
b

brandonmcansh

01/30/2022, 1:54 AM
Sweetness. Thanks @Chris Sinco [G]
t

theapache64

01/30/2022, 7:02 AM
Copy code
val customTextSelectionColors = TextSelectionColors(
    handleColor = Color.Transparent, // 👈🏻
    backgroundColor = Color.Transparent // 👈🏻
)
CompositionLocalProvider(LocalTextSelectionColors provides customTextSelectionColors) { // 👈🏻
    var t1 by remember { mutableStateOf("") }
    OutlinedTextField(
        value = t1,
        onValueChange = { t1 = it },
        keyboardOptions = KeyboardOptions.Default.copy(
            keyboardType = KeyboardType.Number,
        )
    )
}
@Chris Sinco [G] I tried that, but the output looks like this ☝🏻
@Joseph Hawkes-Cates Is there anything am missing here?
UPDATE: I removed
android:background
from
themes.xml
and it worked! 😮 but what if i want to have that value in my
themes.xml
?
j

Joseph Hawkes-Cates

01/30/2022, 4:10 PM
@theapache64 yeah, not sure. I didn’t have that issue after changing the colors to transparent but my field doesn't have a border where you would notice that.
t

theapache64

01/30/2022, 7:05 PM
Yeah yeah. I am using
OutlinedTextField
. But anyway, thanks for sharing your findings. It helped 👍
K 2
z

Zach Klippenstein (he/him) [MOD]

02/01/2022, 2:22 AM
We don't provide a way to disable the handle, because it's a standard feature in android text input. You can always build custom text input from scratch. It's not exactly trivial, but that's something I'm hoping to work on.
3 Views