Ver código fonte

fix: scroll to heading is too slow (#2952) (#3045)

Johan Sutrisno 1 ano atrás
pai
commit
675e23e971

+ 4 - 2
frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/outline/outline_block_component.dart

@@ -180,14 +180,16 @@ class OutlineItemWidget extends StatelessWidget {
     );
   }
 
-  void updateBlockSelection(BuildContext context) {
+  void updateBlockSelection(BuildContext context) async {
     final editorState = context.read<EditorState>();
     editorState.selectionType = SelectionType.block;
     editorState.selection = Selection.collapse(
       node.path,
       node.delta?.length ?? 0,
     );
-    editorState.selectionType = null;
+    WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
+      editorState.selectionType = null;
+    });
   }
 }