feat: add includeChildren option to placeholder extension (#1416)
This commit is contained in:
@@ -12,6 +12,7 @@ export interface PlaceholderOptions {
|
||||
}) => string) | string,
|
||||
showOnlyWhenEditable: boolean,
|
||||
showOnlyCurrent: boolean,
|
||||
includeChildren: boolean,
|
||||
}
|
||||
|
||||
export const Placeholder = Extension.create<PlaceholderOptions>({
|
||||
@@ -23,6 +24,7 @@ export const Placeholder = Extension.create<PlaceholderOptions>({
|
||||
placeholder: 'Write something …',
|
||||
showOnlyWhenEditable: true,
|
||||
showOnlyCurrent: true,
|
||||
includeChildren: false,
|
||||
},
|
||||
|
||||
addProseMirrorPlugins() {
|
||||
@@ -62,7 +64,7 @@ export const Placeholder = Extension.create<PlaceholderOptions>({
|
||||
decorations.push(decoration)
|
||||
}
|
||||
|
||||
return false
|
||||
return this.options.includeChildren
|
||||
})
|
||||
|
||||
return DecorationSet.create(doc, decorations)
|
||||
|
||||
Reference in New Issue
Block a user