From adba9415b3bc9fe21c45e09c0e6520d8282eb28f Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 23 Jul 2020 09:25:01 +0100 Subject: [PATCH] Fix Firefox composer regression exception Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/editor/render.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/editor/render.ts b/src/editor/render.ts index e0f7c07975..8aa5c5dea9 100644 --- a/src/editor/render.ts +++ b/src/editor/render.ts @@ -162,10 +162,10 @@ export function renderModel(editor: HTMLDivElement, model: EditorModel) { lines.forEach((parts, i) => { // find first (and remove anything else) div without className // (as browsers insert these in contenteditable) line container - let lineContainer = editor.children[i]; - while (lineContainer && (lineContainer.tagName !== "DIV" || !!lineContainer.className)) { + let lineContainer = editor.childNodes[i]; + while (lineContainer && ((lineContainer).tagName !== "DIV" || !!(lineContainer).className)) { editor.removeChild(lineContainer); - lineContainer = editor.children[i]; + lineContainer = editor.childNodes[i]; } if (!lineContainer) { lineContainer = document.createElement("div");