mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-11-29 08:19:34 +08:00
Merge branch 'main' of github.com:ueberdosis/tiptap-next into main
This commit is contained in:
commit
1aa613e4eb
@ -1,6 +1,5 @@
|
||||
import { Editor } from '../Editor'
|
||||
import { TextSelection } from 'prosemirror-state'
|
||||
import sleep from '../utils/sleep'
|
||||
import minMax from '../utils/minMax'
|
||||
|
||||
type FocusCommand = (position?: Position) => Editor
|
||||
@ -45,7 +44,7 @@ function resolveSelection(editor: Editor, position: Position = null): ResolvedSe
|
||||
}
|
||||
}
|
||||
|
||||
export default (next: Function, editor: Editor) => async (position = null) => {
|
||||
export default (next: Function, editor: Editor) => (position = null) => {
|
||||
const { view, state } = editor
|
||||
|
||||
if ((view.hasFocus() && position === null) || position === false) {
|
||||
@ -61,7 +60,6 @@ export default (next: Function, editor: Editor) => async (position = null) => {
|
||||
const transaction = tr.setSelection(selection)
|
||||
|
||||
view.dispatch(transaction)
|
||||
await sleep(10)
|
||||
view.focus()
|
||||
next()
|
||||
}
|
Loading…
Reference in New Issue
Block a user