Skip to content

Commit

Permalink
fix: don’t show placeholder if node contains only atom nodes, fix #1457
Browse files Browse the repository at this point in the history
  • Loading branch information
philippkuehn committed Jun 14, 2021
1 parent fe24b6d commit 11b4866
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/extension-placeholder/src/placeholder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 11b4866

Please sign in to comment.