4 ms·
Considering it still needs javascript, this trick seems massively overcomplicated compared to the following: <textarea oninput="this.style.height = 0; this.s
by iza 3y ago
Considering it still needs javascript, this trick seems massively overcomplicated compared to the following:
<textarea oninput="this.style.height = 0; this.style.height = this.scrollHeight + 'px'"></textarea>
(Yes this forces an extra reflow but it likely won't matter)
- SCLeo 3y agoI think all other methods require a reflow as well (internal or external). Because at the end of the day, you still need to measure the height of the text before rendering a larger box.