Fix bug editing in firefox

This commit is contained in:
Matthias Portzel 2022-09-03 08:39:36 -04:00
parent f1217d779e
commit 4ab86115fc
2 changed files with 8 additions and 1 deletions

View File

@ -151,7 +151,7 @@
showMoreButton.parentNode.removeChild(showMoreButton);
// Show the extended text
extended.classList.remove("hidden");
})
});
main.appendChild(showMoreButton);
}

View File

@ -113,6 +113,13 @@
for (const box of textboxes) {
// Set the initial heights of the boxes
updateBoxHeight(box);
// This works fine in Blink, but in Firefox this fails,
// more often on a complex page (pretty much every time on this page;
// less often if I start commenting stuff out, but it still happens)
// So after the first render this re-runs the updateBoxHeight to make sure.
// This does lead to a flash of short-boxes, but it's better than nothing.
setTimeout(updateBoxHeight.bind(null, box), 0);
// Add an event listener to update the box height on key press
box.addEventListener("input", evt => updateBoxHeight(box));
// Allow pasting images into either text box