Is there any simple way to ellipsis-end text in `T...
# compose
p
Is there any simple way to ellipsis-end text in
TextField
? I have a read-only text field on a single line.
e
A "read only TextField" is, by definition, NOT a text field. Swap it out with a
Text
that uses the exact same vuisual styling. Everything else is a workaround.
a
BasicTextField does have a readOnly parameter, and having non-editable textfields is a legit use case (disable editing while loading or when you don't have edit rights). It's weird how there is not overflow param like on Text. I'd open a feature request on the Google issue tracker
👍 1
e
> It's weird how there is not overflow param like on Text I wouldnt say its weird, its a text field, realistically, how would an
overflow
parameter behave where you have
readOnly
&
scrollState
& even
lineLimits
? It makes no sense to add one. And my hot take is that
readOnly
shouldn't have been API also. Its dead simple and more idiomatic to swap out the
innerTextField
for a
Text
composable based on whatever boolean flag or logic via the text field decorator.