fix: don’t show placeholder if node contains only atom nodes, fix #1457

This commit is contained in:
Philipp Kühn
2021-06-14 15:07:17 +02:00
parent fe24b6d7de
commit 11b4866948

View File

@@ -40,7 +40,7 @@ export const Placeholder = Extension.create<PlaceholderOptions>({
doc.descendants((node, pos) => {
const hasAnchor = anchor >= pos && anchor <= (pos + node.nodeSize)
const isEmpty = !node.isLeaf && !node.textContent
const isEmpty = !node.isLeaf && !node.childCount
if ((hasAnchor || !this.options.showOnlyCurrent) && isEmpty) {
const classes = [this.options.emptyNodeClass]