it it possible to disable the label animation for ...
# compose
m
it it possible to disable the label animation for OutlinedTextField? I have label and placeholder. I don’t want the label to jump around
👀 3
🧵 1
c
I think you have to create your own text field component to do that.
m
yes. that’s what i am doing atm 😛 thank
z
Im in a similar spot. It might be worth exploring using an empty string for the empty state (" ") which floats the label to the top, then adjusting it with
Modifier.onFocusChanged
such that the input string is actually empty ("") when focus is gained and the user is ready to input text, then setting it back to (" ") when focus is lost if the input is still empty. I dont know if this has any other side effects, in theory it should work, but I havent tried it yet. In my case Im reluctant to create a custom BasicTextField due to the maintenance overhead it implies in the long run. If you do decide to try it, let me know - Id love to know the results. I might update later on if I do decide to try it myself too!
m
i just made my own column component. i needed fixed label, hint and error
its actually pretty easy!
z
Glad that works for you! 👍🏽👍🏽