Jetpack compose does this automatically I believe. You can see it on our profile edit page. We didn't do anything to make it wokr there.
The issue on the New Post screen is on my dumb TextField that renders @names, domains, nip19, hashtags and so on.. as people type. And the change in text field size from that rendering interferes with the automatic behavior of jetpack compose. So I had to remove it while I figure out a solution for it. We will figure it out eventually. But for any basic app, this is all automatic.