From 675e23e971dcd3fefcbb12ac193778dbeb8a1594 Mon Sep 17 00:00:00 2001 From: Johan Sutrisno Date: Thu, 10 Aug 2023 17:36:53 +0700 Subject: [PATCH] fix: scroll to heading is too slow (#2952) (#3045) --- .../editor_plugins/outline/outline_block_component.dart | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/outline/outline_block_component.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/outline/outline_block_component.dart index 14ab936246..90aeb1b006 100644 --- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/outline/outline_block_component.dart +++ b/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.selectionType = SelectionType.block; editorState.selection = Selection.collapse( node.path, node.delta?.length ?? 0, ); - editorState.selectionType = null; + WidgetsBinding.instance.addPostFrameCallback((timeStamp) { + editorState.selectionType = null; + }); } }