Multiline input "stretch to fit content" defaults to 2 lines

Thanks for sharing!

On the same topic, I wonder how we can make the multiline input expand upwards and not downwards, and up to a specified maximum number of lines?

No text: 1 line

Some short text: expanding from 1 to 2, then 3, then X lines

Long text: limited to 5 lines + scrollbar