set capture to true for mousedown event listener

This commit is contained in:
bepsvpt 2020-03-30 16:50:28 +08:00
parent d4d070ae7a
commit e4a20be5c7
No known key found for this signature in database
GPG Key ID: 6700B07822B5F1BF
3 changed files with 3 additions and 3 deletions

View File

@ -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)

View File

@ -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) {

View File

@ -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)