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

This commit is contained in:
Johan Sutrisno
2023-08-10 17:36:53 +07:00
committed by GitHub
parent c9ee82ec75
commit 675e23e971

View File

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