From c7432e640be8dcb56e5d0a9124e9a4f417223278 Mon Sep 17 00:00:00 2001 From: "Lucas.Xu" Date: Tue, 2 Aug 2022 20:22:39 +0800 Subject: [PATCH] feat: delay rendering selection(need to be refactored). --- .../app_flowy/packages/flowy_editor/lib/editor_state.dart | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/app_flowy/packages/flowy_editor/lib/editor_state.dart b/frontend/app_flowy/packages/flowy_editor/lib/editor_state.dart index 277b742604..92a05fc880 100644 --- a/frontend/app_flowy/packages/flowy_editor/lib/editor_state.dart +++ b/frontend/app_flowy/packages/flowy_editor/lib/editor_state.dart @@ -60,7 +60,12 @@ class EditorState { for (final op in transaction.operations) { _applyOperation(op); } - updateCursorSelection(transaction.afterSelection); + // updateCursorSelection(transaction.afterSelection); + + // FIXME: don't use delay + Future.delayed(const Duration(milliseconds: 16), () { + updateCursorSelection(transaction.afterSelection); + }); if (options.recordUndo) { final undoItem = undoManager.getUndoHistoryItem();