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