Hacker News new | ask | show | jobs
by throwaway858 960 days ago
The technique for "Make a textarea auto-expand" is obsoleted by a new CSS property("form-sizing"):

https://chriscoyier.net/2023/09/29/css-solves-auto-expanding...

Even without using this new CSS property, the technique that is used (adjusting the "height" of the element) is not ideal and can be glitchy.

A better approach is to use a mirror hidden element:

https://css-tricks.com/the-cleanest-trick-for-autogrowing-te...