mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-01-18 06:03:22 +08:00
feat: add includeChildren
option to placeholder extension (#1416)
This commit is contained in:
parent
14e458ea7d
commit
1799b907ec
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user