include bubble menu element when checking if the editor view still has focus (#3150)
This commit is contained in:
@@ -55,8 +55,15 @@ export class BubbleMenuView {
|
|||||||
const isEmptyTextBlock = !doc.textBetween(from, to).length
|
const isEmptyTextBlock = !doc.textBetween(from, to).length
|
||||||
&& isTextSelection(state.selection)
|
&& isTextSelection(state.selection)
|
||||||
|
|
||||||
|
// When clicking on a element inside the bubble menu the editor "blur" event
|
||||||
|
// is called and the bubble menu item is focussed. In this case we should
|
||||||
|
// consider the menu as part of the ditor and keep showing the menu
|
||||||
|
const isChildOfMenu = this.element.contains(document.activeElement)
|
||||||
|
|
||||||
|
const hasEditorFocus = view.hasFocus() || isChildOfMenu
|
||||||
|
|
||||||
if (
|
if (
|
||||||
!view.hasFocus()
|
!hasEditorFocus
|
||||||
|| empty
|
|| empty
|
||||||
|| isEmptyTextBlock
|
|| isEmptyTextBlock
|
||||||
) {
|
) {
|
||||||
|
|||||||
Reference in New Issue
Block a user