Skip to content

Commit

Permalink
fix: show bubble menu for atom nodes even if there is no text content,
Browse files Browse the repository at this point in the history
…fix #1446
  • Loading branch information
philippkuehn committed Jun 14, 2021
1 parent 6034eb9 commit a3a7650
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/extension-bubble-menu/src/bubble-menu-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a3a7650

Please sign in to comment.