Fix trailing newlines not actually generating a new line in the imposter
This was causing vertical scroll offset issues
This commit is contained in:
parent
7697643966
commit
0c4aa2eeb9
@ -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];
|
||||||
|
Loading…
Reference in New Issue
Block a user