fix: show bubble menu for atom nodes even if there is no text content, fix #1446

This commit is contained in:
Philipp Kühn 2021-06-14 18:58:10 +02:00
parent 6034eb9b30
commit a3a7650784

View File

@ -102,7 +102,10 @@ export class BubbleMenuView {
// Sometime check for `empty` is not enough.
// Doubleclick an empty paragraph returns a node size of 2.
// So we check also for an empty text size.
if (empty || !$anchor.parent.textContent) {
const { parent } = $anchor
const isEmptyTextBlock = parent.type.isTextblock && !parent.textContent
if (empty || isEmptyTextBlock) {
this.hide()
return