mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-11-24 11:49:02 +08:00
Add Plugin Key to placeholder component. (#3652)
* Add Plugin Key to placeholder component. Key added to fix error duplicate plugin when using `Placeholder` component. * Add PluginKey import --------- Co-authored-by: Dominik <6538827+bdbch@users.noreply.github.com>
This commit is contained in:
parent
c8f8295146
commit
125caf4965
@ -1,6 +1,6 @@
|
||||
import { Editor, Extension } from '@tiptap/core'
|
||||
import { Node as ProsemirrorNode } from '@tiptap/pm/model'
|
||||
import { Plugin } from '@tiptap/pm/state'
|
||||
import { Plugin, PluginKey } from '@tiptap/pm/state'
|
||||
import { Decoration, DecorationSet } from '@tiptap/pm/view'
|
||||
|
||||
export interface PlaceholderOptions {
|
||||
@ -36,6 +36,7 @@ export const Placeholder = Extension.create<PlaceholderOptions>({
|
||||
addProseMirrorPlugins() {
|
||||
return [
|
||||
new Plugin({
|
||||
key: new PluginKey('placeholder'),
|
||||
props: {
|
||||
decorations: ({ doc, selection }) => {
|
||||
const active = this.editor.isEditable || !this.options.showOnlyWhenEditable
|
||||
|
Loading…
Reference in New Issue
Block a user