Fix bug editing in firefox
This commit is contained in:
parent
f1217d779e
commit
4ab86115fc
|
@ -151,7 +151,7 @@
|
||||||
showMoreButton.parentNode.removeChild(showMoreButton);
|
showMoreButton.parentNode.removeChild(showMoreButton);
|
||||||
// Show the extended text
|
// Show the extended text
|
||||||
extended.classList.remove("hidden");
|
extended.classList.remove("hidden");
|
||||||
})
|
});
|
||||||
main.appendChild(showMoreButton);
|
main.appendChild(showMoreButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -113,6 +113,13 @@
|
||||||
for (const box of textboxes) {
|
for (const box of textboxes) {
|
||||||
// Set the initial heights of the boxes
|
// Set the initial heights of the boxes
|
||||||
updateBoxHeight(box);
|
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));
|
box.addEventListener("input", evt => updateBoxHeight(box));
|
||||||
|
|
||||||
// Allow pasting images into either text box
|
// Allow pasting images into either text box
|
||||||
|
|
Loading…
Reference in New Issue