Skip to content

Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.

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

Johan Sutrisno675e23e971dc
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>();
editorState.selectionType = SelectionType.block;
editorState.selection = Selection.collapse(
node.path,
node.delta?.length ?? 0,
);
- editorState.selectionType = null;
+ WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
+ editorState.selectionType = null;
+ });
}
}