mirror of
https://github.com/NoRedInk/noredink-ui.git
synced 2024-12-24 22:21:45 +03:00
b907c12d7a
The old logic looked like this: ``` if (this._textarea.scrollHeight > minHeight) { this._textarea.style.height = minHeight + 'px' this._textarea.style.height = this._textarea.scrollHeight + 'px' } ``` Imagine a case where the `minHeight` is actually less than the current height of the text area due to the current content. The height of the element would be set to a smaller value, and then later reset to the desired height. This causes the overall scroll height of the page to shrink (because the text-area did), and then expand again. Now the scroll position for the user on the page has changed, and this happens on every keystroke. This change just skips the first assignment to `.height`. I'm not sure why it was initially there, but I can't see a reason for keeping it (especially since it seems to be the cause of this bug). |
||
---|---|---|
.. | ||
TextArea | ||
CustomElement.js | ||
index.js |