top | item 37718914

(no title)

iza | 2 years 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)

discuss

order

SCLeo|2 years ago

I 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.