Fix trailing newlines not actually generating a new line in the imposter

This was causing vertical scroll offset issues
This commit is contained in:
toasted-nutbread 2020-02-23 13:04:55 -05:00
parent 7697643966
commit 0c4aa2eeb9

View File

@ -50,7 +50,9 @@ function docImposterCreate(element, isTextarea) {
const imposter = document.createElement('div'); const imposter = document.createElement('div');
const imposterStyle = imposter.style; 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) { for (let i = 0, ii = elementStyle.length; i < ii; ++i) {
const property = elementStyle[i]; const property = elementStyle[i];