fix emptyTextBlock detection to handle leaf nodes too

This commit is contained in:
Dominik Biedebach 2024-11-17 17:57:22 +01:00
parent d91f774e11
commit 094bc79f72

View File

@ -68,7 +68,8 @@ export class FloatingMenuView {
const { selection } = state
const { $anchor, empty } = selection
const isRootDepth = $anchor.depth === 1
const isEmptyTextBlock = $anchor.parent.isTextblock && !$anchor.parent.type.spec.code && !$anchor.parent.textContent
const isEmptyTextBlock = $anchor.parent.isTextblock && !$anchor.parent.type.spec.code && !$anchor.parent.textContent && $anchor.parent.childCount === 0
if (
!view.hasFocus()