mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-11-27 14:59:27 +08:00
fix emptyTextBlock detection to handle leaf nodes too
This commit is contained in:
parent
d91f774e11
commit
094bc79f72
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user