From 110c3bd7bfbbe5fe51d29c828fc0093e2832deb2 Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Fri, 15 Sep 2023 17:02:37 +0200 Subject: [PATCH] Clean up wrappers created for tooltips when the parent option is given FIX: Fix an issue that caused the tooltip system to leave empty nodes in the DOM when an editor using the `parent` option to `tooltips` is destroyed. Closes https://github.com/codemirror/dev/issues/1253 --- src/tooltip.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tooltip.ts b/src/tooltip.ts index c53d52f..295cf26 100644 --- a/src/tooltip.ts +++ b/src/tooltip.ts @@ -225,6 +225,7 @@ const tooltipPlugin = ViewPlugin.fromClass(class { tooltipView.dom.remove() tooltipView.destroy?.() } + if (this.parent) this.container.remove() this.intersectionObserver?.disconnect() clearTimeout(this.measureTimeout) }