Closed fregante closed 5 years ago
Sadly not possible: https://stackoverflow.com/questions/46516425/why-range-getboundingclientrect-returns-0-for-range-inside-textarea
And definitely not in Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=85686
Perhaps the height of the content can be found by selecting the text and measuring its BoundingBox, and the padding can be added.
If this works, it wouldn’t be necessary to reset the height of the textarea and thus we wouldn’t need to keep track of the scroll position.
Zalgo and lineHeight also needs to be tested