diff --git a/packages/tiptap/src/Plugins/FloatingMenu.js b/packages/tiptap/src/Plugins/FloatingMenu.js index 25a8f46d9..c5c6ea1fd 100644 --- a/packages/tiptap/src/Plugins/FloatingMenu.js +++ b/packages/tiptap/src/Plugins/FloatingMenu.js @@ -18,7 +18,7 @@ class Menu { // the mousedown event is fired before blur so we can prevent it this.mousedownHandler = this.handleClick.bind(this) - this.options.element.addEventListener('mousedown', this.mousedownHandler) + this.options.element.addEventListener('mousedown', this.mousedownHandler, { capture: true }) this.options.editor.on('focus', ({ view }) => { this.update(view) diff --git a/packages/tiptap/src/Plugins/MenuBar.js b/packages/tiptap/src/Plugins/MenuBar.js index fb8e1e7e3..b4e6c0de5 100644 --- a/packages/tiptap/src/Plugins/MenuBar.js +++ b/packages/tiptap/src/Plugins/MenuBar.js @@ -8,7 +8,7 @@ class Menu { // the mousedown event is fired before blur so we can prevent it this.mousedownHandler = this.handleClick.bind(this) - this.options.element.addEventListener('mousedown', this.mousedownHandler) + this.options.element.addEventListener('mousedown', this.mousedownHandler, { capture: true }) this.options.editor.on('blur', () => { if (this.preventHide) { diff --git a/packages/tiptap/src/Plugins/MenuBubble.js b/packages/tiptap/src/Plugins/MenuBubble.js index f28681619..d184009b5 100644 --- a/packages/tiptap/src/Plugins/MenuBubble.js +++ b/packages/tiptap/src/Plugins/MenuBubble.js @@ -71,7 +71,7 @@ class Menu { // the mousedown event is fired before blur so we can prevent it this.mousedownHandler = this.handleClick.bind(this) - this.options.element.addEventListener('mousedown', this.mousedownHandler) + this.options.element.addEventListener('mousedown', this.mousedownHandler, { capture: true }) this.options.editor.on('focus', ({ view }) => { this.update(view)