add something broken again

This commit is contained in:
Philipp Kühn
2019-02-06 00:03:23 +01:00
parent f4fa5a8e70
commit 6a0aaf15e6
2 changed files with 81 additions and 19 deletions

View File

@@ -32,6 +32,7 @@ export default class Editor {
onFocus: () => {},
onBlur: () => {},
onPaste: () => {},
onTransaction: () => true,
}
this.init(options)
@@ -265,6 +266,10 @@ export default class Editor {
}
dispatchTransaction(transaction) {
if (!this.options.onTransaction(transaction)) {
return
}
this.state = this.state.apply(transaction)
this.view.updateState(this.state)
this.setActiveNodesAndMarks()