mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-01-18 14:13:21 +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,
|
}) => string) | string,
|
||||||
showOnlyWhenEditable: boolean,
|
showOnlyWhenEditable: boolean,
|
||||||
showOnlyCurrent: boolean,
|
showOnlyCurrent: boolean,
|
||||||
|
includeChildren: boolean,
|
||||||
}
|
}
|
||||||
|
|
||||||
export const Placeholder = Extension.create<PlaceholderOptions>({
|
export const Placeholder = Extension.create<PlaceholderOptions>({
|
||||||
@ -23,6 +24,7 @@ export const Placeholder = Extension.create<PlaceholderOptions>({
|
|||||||
placeholder: 'Write something …',
|
placeholder: 'Write something …',
|
||||||
showOnlyWhenEditable: true,
|
showOnlyWhenEditable: true,
|
||||||
showOnlyCurrent: true,
|
showOnlyCurrent: true,
|
||||||
|
includeChildren: false,
|
||||||
},
|
},
|
||||||
|
|
||||||
addProseMirrorPlugins() {
|
addProseMirrorPlugins() {
|
||||||
@ -62,7 +64,7 @@ export const Placeholder = Extension.create<PlaceholderOptions>({
|
|||||||
decorations.push(decoration)
|
decorations.push(decoration)
|
||||||
}
|
}
|
||||||
|
|
||||||
return false
|
return this.options.includeChildren
|
||||||
})
|
})
|
||||||
|
|
||||||
return DecorationSet.create(doc, decorations)
|
return DecorationSet.create(doc, decorations)
|
||||||
|
Loading…
Reference in New Issue
Block a user