From 0c4aa2eeb96a3d57555865576f9e5285d3c49fb7 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sun, 23 Feb 2020 13:04:55 -0500 Subject: Fix trailing newlines not actually generating a new line in the imposter This was causing vertical scroll offset issues --- ext/fg/js/document.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ext/fg/js/document.js b/ext/fg/js/document.js index 1a3e8791..35861475 100644 --- a/ext/fg/js/document.js +++ b/ext/fg/js/document.js @@ -50,7 +50,9 @@ function docImposterCreate(element, isTextarea) { const imposter = document.createElement('div'); const imposterStyle = imposter.style; - imposter.textContent = element.value; + let value = element.value; + if (value.endsWith('\n')) { value += '\n'; } + imposter.textContent = value; for (let i = 0, ii = elementStyle.length; i < ii; ++i) { const property = elementStyle[i]; -- cgit v1.2.3