From 7b18c4b613f8bf4f5a81213a6b6c6f0ed22a85d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Ku=CC=88hn?= Date: Fri, 11 Sep 2020 11:32:15 +0200 Subject: [PATCH] dont use async commans --- packages/core/src/commands/focus.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/core/src/commands/focus.ts b/packages/core/src/commands/focus.ts index 818dc3fd..be1bd171 100644 --- a/packages/core/src/commands/focus.ts +++ b/packages/core/src/commands/focus.ts @@ -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() } \ No newline at end of file