Skip to content

Commit 4a0e316

Browse files
fix: make link hovered by mouse only considered in updates dispatched by mouseover handler (#1486)
1 parent 208b88d commit 4a0e316

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/core/src/extensions/LinkToolbar/LinkToolbarPlugin.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class LinkToolbarView implements PluginView {
5252

5353
this.startMenuUpdateTimer = () => {
5454
this.menuUpdateTimer = setTimeout(() => {
55-
this.update(this.pmView);
55+
this.update(this.pmView, undefined, true);
5656
}, 250);
5757
};
5858

@@ -190,7 +190,7 @@ class LinkToolbarView implements PluginView {
190190
}
191191
}
192192

193-
update(view: EditorView, oldState?: EditorState) {
193+
update(view: EditorView, oldState?: EditorState, fromMouseOver = false) {
194194
const { state } = view;
195195

196196
const isSame =
@@ -235,7 +235,7 @@ class LinkToolbarView implements PluginView {
235235
}
236236
}
237237

238-
if (this.mouseHoveredLinkMark) {
238+
if (this.mouseHoveredLinkMark && fromMouseOver) {
239239
this.linkMark = this.mouseHoveredLinkMark;
240240
this.linkMarkRange = this.mouseHoveredLinkMarkRange;
241241
}

0 commit comments

Comments
 (0)