fix: maybe hide tippy on blur, fix #1433

This commit is contained in:
Philipp Kühn 2021-12-15 10:12:55 +01:00
parent 1645df9adc
commit 063ced27ca
2 changed files with 14 additions and 0 deletions

View File

@ -139,6 +139,13 @@ export class BubbleMenuView {
hideOnClick: 'toggle',
...this.tippyOptions,
})
// maybe we have to hide tippy on its own blur event as well
if (this.tippy.popper.firstChild) {
(this.tippy.popper.firstChild as HTMLElement).addEventListener('blur', event => {
this.blurHandler({ event })
})
}
}
update(view: EditorView, oldState?: EditorState) {

View File

@ -121,6 +121,13 @@ export class FloatingMenuView {
hideOnClick: 'toggle',
...this.tippyOptions,
})
// maybe we have to hide tippy on its own blur event as well
if (this.tippy.popper.firstChild) {
(this.tippy.popper.firstChild as HTMLElement).addEventListener('blur', event => {
this.blurHandler({ event })
})
}
}
update(view: EditorView, oldState?: EditorState) {