From daac91d0e575c22b40f128172e3f805a2a92dce2 Mon Sep 17 00:00:00 2001 From: Jonas Date: Mon, 25 Mar 2024 10:38:56 +0100 Subject: [PATCH] fix(LinkBubble): Limit hide on scroll to div elements Don't hide e.g. when scrolling in an input element. Fixes: #5497 Signed-off-by: Jonas --- src/plugins/LinkBubblePluginView.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/plugins/LinkBubblePluginView.js b/src/plugins/LinkBubblePluginView.js index a0b34a9596f..4310c20a595 100644 --- a/src/plugins/LinkBubblePluginView.js +++ b/src/plugins/LinkBubblePluginView.js @@ -25,10 +25,16 @@ class LinkBubblePluginView { } dragOrScrollHandler = (event) => { + // Only hide when scrolling on `
` (not .e.g. on ``) + if (event.target.nodeName !== 'DIV') { + return + } + // Cypress fires unexpected scroll events, which breaks testing the link bubble if (window.Cypress) { return } + this.hide() }