Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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)


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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: