I am trying to:
- make the
trailingIcon
ofTextField
composable visible only if the user enters some text other than white spaces. - Later when the user clicks the
trailingIcon
the text in theTextField
should get cleared and thetrailingIcon
should disappear. - Again when the user enters a text other than space, the
trailingIcon
should appear and enable this text clearing feature.
and so on...
I tried searching for solutions to this problem but mostly they were focused on "visible trailingIcons
" and not what I was trying to implement.
Depending on text state you can specify
null
or actual view fortrailingIcon
parameter: