fix: update the selection after render completed

This commit is contained in:
Lucas.Xu 2022-08-03 22:53:19 +08:00
parent eb7c65aa8b
commit 90fa1312f2
2 changed files with 1 additions and 5 deletions

View File

@ -60,10 +60,8 @@ class EditorState {
for (final op in transaction.operations) {
_applyOperation(op);
}
// updateCursorSelection(transaction.afterSelection);
// FIXME: don't use delay
Future.delayed(const Duration(milliseconds: 16), () {
WidgetsBinding.instance.addPostFrameCallback((_) {
updateCursorSelection(transaction.afterSelection);
});

View File

@ -153,8 +153,6 @@ class _PopupListWidgetState extends State<PopupListWidget> {
@override
Widget build(BuildContext context) {
// TODO: Is there a better way to get focus?
return Focus(
focusNode: focusNode,
onKey: _onKey,