fix: don’t show placeholder if node contains only atom nodes, fix #1457
This commit is contained in:
@@ -40,7 +40,7 @@ export const Placeholder = Extension.create<PlaceholderOptions>({
|
|||||||
|
|
||||||
doc.descendants((node, pos) => {
|
doc.descendants((node, pos) => {
|
||||||
const hasAnchor = anchor >= pos && anchor <= (pos + node.nodeSize)
|
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) {
|
if ((hasAnchor || !this.options.showOnlyCurrent) && isEmpty) {
|
||||||
const classes = [this.options.emptyNodeClass]
|
const classes = [this.options.emptyNodeClass]
|
||||||
|
|||||||
Reference in New Issue
Block a user