소스 검색

feat: delay rendering selection(need to be refactored).

Lucas.Xu 2 년 전
부모
커밋
c7432e640b
1개의 변경된 파일6개의 추가작업 그리고 1개의 파일을 삭제
  1. 6 1
      frontend/app_flowy/packages/flowy_editor/lib/editor_state.dart

+ 6 - 1
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();