do not show placeholder if non editable

This commit is contained in:
Philipp Kühn
2019-02-06 11:28:40 +01:00
parent 44525063bc
commit 9b90d6437e
3 changed files with 17 additions and 2 deletions

View File

@@ -1,4 +1,4 @@
import { EditorState, Plugin } from 'prosemirror-state'
import { EditorState, Plugin, PluginKey } from 'prosemirror-state'
import { EditorView } from 'prosemirror-view'
import { Schema, DOMParser, DOMSerializer } from 'prosemirror-model'
import { dropCursor } from 'prosemirror-dropcursor'
@@ -162,8 +162,13 @@ export default class Editor {
dropCursor(this.options.dropCursor),
gapCursor(),
new Plugin({
key: new PluginKey('editable'),
props: {
editable: () => this.options.editable,
},
}),
new Plugin({
props: {
attributes: {
tabindex: 0,
},