Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
iza
on Sept 30, 2023
|
parent
|
context
|
favorite
| on:
CSS solves auto-expanding textareas (probably, eve...
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
on Oct 3, 2023
[–]
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: