6 ms·
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
by throwaway858 3y 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-textareas-probably-eventually/ 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-textareas/ https://css-tricks.com/the-cleanest-trick-for-autogrowing-te...