mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-12-14 18:49:02 +08:00
Merge pull request #646 from Juice-Codes/fix-issue-485
set capture to true for mousedown event listener
This commit is contained in:
commit
5ce66cd8f2
@ -18,7 +18,7 @@ class Menu {
|
|||||||
|
|
||||||
// the mousedown event is fired before blur so we can prevent it
|
// the mousedown event is fired before blur so we can prevent it
|
||||||
this.mousedownHandler = this.handleClick.bind(this)
|
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.options.editor.on('focus', ({ view }) => {
|
||||||
this.update(view)
|
this.update(view)
|
||||||
|
@ -8,7 +8,7 @@ class Menu {
|
|||||||
|
|
||||||
// the mousedown event is fired before blur so we can prevent it
|
// the mousedown event is fired before blur so we can prevent it
|
||||||
this.mousedownHandler = this.handleClick.bind(this)
|
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', () => {
|
this.options.editor.on('blur', () => {
|
||||||
if (this.preventHide) {
|
if (this.preventHide) {
|
||||||
|
@ -71,7 +71,7 @@ class Menu {
|
|||||||
|
|
||||||
// the mousedown event is fired before blur so we can prevent it
|
// the mousedown event is fired before blur so we can prevent it
|
||||||
this.mousedownHandler = this.handleClick.bind(this)
|
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.options.editor.on('focus', ({ view }) => {
|
||||||
this.update(view)
|
this.update(view)
|
||||||
|
Loading…
Reference in New Issue
Block a user