diff --git a/src/plugins/LinkBubblePluginView.js b/src/plugins/LinkBubblePluginView.js index a0b34a9596f..ffa6a280451 100644 --- a/src/plugins/LinkBubblePluginView.js +++ b/src/plugins/LinkBubblePluginView.js @@ -11,6 +11,7 @@ class LinkBubblePluginView { this.options = options this.view = view this.plugin = plugin + this.scrollContainer = document.querySelector('.splitpanes__pane-details') this.#component = new VueRenderer(LinkBubbleView, { parent: this.options.parent, @@ -21,7 +22,7 @@ class LinkBubblePluginView { }) this.view.dom.addEventListener('dragstart', this.dragOrScrollHandler) - document.addEventListener('scroll', this.dragOrScrollHandler, { capture: true }) + this.scrollContainer.addEventListener('scroll', this.dragOrScrollHandler) } dragOrScrollHandler = (event) => { @@ -102,7 +103,7 @@ class LinkBubblePluginView { destroy() { this.tippy?.destroy() this.view.dom.removeEventListener('dragstart', this.dragOrScrollHandler) - document.removeEventListener('scroll', this.dragOrScrollHandler, { capture: true }) + this.scrollContainer.removeEventListener('scroll', this.dragOrScrollHandler, { capture: true }) } }