mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-12-15 11:09:01 +08:00
refactoring
This commit is contained in:
parent
728ef2cef9
commit
b8c2238a0a
@ -346,16 +346,14 @@ export default class Editor extends Emitter {
|
|||||||
if (position === 'start' || position === true) {
|
if (position === 'start' || position === true) {
|
||||||
pos = 0
|
pos = 0
|
||||||
} else if (position === 'end') {
|
} else if (position === 'end') {
|
||||||
pos = this.view.state.doc.nodeSize - 2
|
pos = this.state.doc.nodeSize - 2
|
||||||
}
|
}
|
||||||
|
|
||||||
const selection = TextSelection.near(this.view.state.doc.resolve(pos))
|
const selection = TextSelection.near(this.state.doc.resolve(pos))
|
||||||
const transaction = this.view.state.tr.setSelection(selection)
|
const transaction = this.state.tr.setSelection(selection)
|
||||||
this.view.dispatch(transaction)
|
this.view.dispatch(transaction)
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => this.view.focus(), 10)
|
||||||
this.view.focus()
|
|
||||||
}, 10)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
blur() {
|
blur() {
|
||||||
|
Loading…
Reference in New Issue
Block a user