From f5cfb8b13557d970b8d4904c0621abd8a264ac35 Mon Sep 17 00:00:00 2001 From: John McLear Date: Sun, 10 Jan 2021 15:50:01 +0000 Subject: [PATCH] tidy up --- src/static/js/scroll.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/static/js/scroll.js b/src/static/js/scroll.js index dcca9e9e5..f752757da 100644 --- a/src/static/js/scroll.js +++ b/src/static/js/scroll.js @@ -290,12 +290,15 @@ Scroll.prototype.scrollNodeVerticallyIntoView = function (rep, innerHeight) { distanceOfTopOfViewport - this._getPixelsRelativeToPercentageOfViewport(innerHeight, true); this._scrollYPage(pixelsToScroll); } else if (caretIsBelowOfViewport) { - this.scrollWhenCaretIsInTheLastLineOfViewportWhenNecessary(rep, true, innerHeight); // setTimeout is required here as line might not be fully rendered onto the pad setTimeout(() => { const outer = window.parent; - outer.scrollTo(0, outer[0].innerHeight) + // scroll to the very end of the pad outer + outer.scrollTo(0, outer[0].innerHeight); }, 150); + // if the above setTimeout and functionality is removed then hitting an enter + // key while on the last line wont be an optimal user experience + // Details at: https://github.com/ether/etherpad-lite/pull/4639/files } } };