Fix jumpy textarea with long content in post edit
We manually reset the scroll position, to avoid height = 'auto' jump to the top Fixes #971
This commit is contained in:
parent
a59bbf50d7
commit
9c46b347b8
1 changed files with 6 additions and 0 deletions
|
@ -275,8 +275,14 @@ window.onload = function () {
|
||||||
};
|
};
|
||||||
function init () {
|
function init () {
|
||||||
function resize () {
|
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 = 'auto';
|
||||||
description.style.height = description.scrollHeight+10+'px';
|
description.style.height = description.scrollHeight+10+'px';
|
||||||
|
|
||||||
|
window.scrollTo(0, scrollTop);
|
||||||
}
|
}
|
||||||
/* 0-timeout to get the already changed text */
|
/* 0-timeout to get the already changed text */
|
||||||
function delayedResize () {
|
function delayedResize () {
|
||||||
|
|
Loading…
Reference in a new issue