feat: add pos to placeholder props

This commit is contained in:
Philipp Kühn 2021-10-12 23:30:30 +02:00
parent a06213f137
commit eb5374321b

View File

@ -9,6 +9,7 @@ export interface PlaceholderOptions {
placeholder: ((PlaceholderProps: {
editor: Editor,
node: ProsemirrorNode,
pos: number,
}) => string) | string,
showOnlyWhenEditable: boolean,
showOnlyCurrent: boolean,
@ -57,6 +58,7 @@ export const Placeholder = Extension.create<PlaceholderOptions>({
? this.options.placeholder({
editor: this.editor,
node,
pos,
})
: this.options.placeholder,
})