From 28eb99a59c07ba8683913d73925b70948f077522 Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Fri, 12 Apr 2024 09:39:42 +0200 Subject: [PATCH] Fix a regression in tooltip arrows FIX: Fix a crash when multiple tooltips with arrows are shown. Closes https://github.com/codemirror/dev/issues/1367 --- src/tooltip.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tooltip.ts b/src/tooltip.ts index 9d6fe76..6313b38 100644 --- a/src/tooltip.ts +++ b/src/tooltip.ts @@ -226,7 +226,7 @@ const tooltipPlugin = ViewPlugin.fromClass(class { if (tooltip.arrow && !tooltipView.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")) { let arrow = document.createElement("div") arrow.className = "cm-tooltip-arrow" - tooltipView.dom.insertBefore(arrow, before) + tooltipView.dom.appendChild(arrow) } tooltipView.dom.style.position = this.position tooltipView.dom.style.top = Outside