Id love to align the `trailingIcon` of my `TextFie...
# compose
Id love to align the
of my
with the input text. Is there a "safe" way to do this? All I can think of is offsetting it by some magic number based on the entire fields size.. but that doesnt feel like a good solution in the long run blob sweat smile
You could align by the last baseline, but that might not work when the text is empty. @Halil Ozercan do you have any ideas?
How would I go about doing that? I know that RowScope has
but the trailing lambda for the icon is just
@Composable () -> Unit
I guess you’d need to copy the implementation of the material text field
TextField uses a custom layout to place its items. Trailing Icon is placed according to
alignment.;l=733 You would have to go very deep in your copy paste and change this alignment. There is
in arguments, it might be of help.
Thanks to you both for responding. I was afraid that this would be the solution. Ill leave it be for now homer disappear
Maybe do your own thing with BasicTextFields’ decoration box?? Might be less traumatising? Still not sure thatll work without magic padding
Thanks @Ale Stamato! I have similar trauma/issues with that unfortunately. Both solutions would eventually lead to me having a rough time keeping up with design changes, either on my end of things, or in material itself. It would be nice to solve this issue (in a simpler way) but for me it doesnt seem worth it to copy or create my own variant just to be able to do this!