Merge pull request #646 from Juice-Codes/fix-issue-485

set capture to true for mousedown event listener
This commit is contained in:
Philipp Kühn 2020-04-01 20:30:09 +02:00 committed by GitHub
commit 5ce66cd8f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 // 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)

View File

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

View File

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