Merge pull request #980 from ArthurHoaro/hotfix/textarea-resize-jumpy

Fix jumpy textarea with long content in post edit
This commit is contained in:
VirtualTam 2017-10-06 14:31:16 +02:00 committed by GitHub
commit b3e39bf57e
1 changed files with 6 additions and 0 deletions

View File

@ -275,8 +275,14 @@ window.onload = function () {
};
function init () {
function resize () {
/* Fix jumpy resizing: https://stackoverflow.com/a/18262927/1484919 */
var scrollTop = window.pageYOffset ||
(document.documentElement || document.body.parentNode || document.body).scrollTop;
description.style.height = 'auto';
description.style.height = description.scrollHeight+10+'px';
window.scrollTo(0, scrollTop);
}
/* 0-timeout to get the already changed text */
function delayedResize () {