delay focus, fix #268

This commit is contained in:
Philipp Kühn
2019-05-17 23:46:15 +02:00
parent 5ec5168cc1
commit c0713b64af

View File

@@ -78,9 +78,7 @@ export default class Editor extends Emitter {
this.setActiveNodesAndMarks() this.setActiveNodesAndMarks()
if (this.options.autoFocus) { if (this.options.autoFocus) {
setTimeout(() => { this.focus()
this.focus()
}, 10)
} }
this.events.forEach(name => { this.events.forEach(name => {
@@ -342,7 +340,9 @@ export default class Editor extends Emitter {
this.view.dispatch(transaction) this.view.dispatch(transaction)
} }
this.view.focus() setTimeout(() => {
this.view.focus()
}, 10)
} }
blur() { blur() {