From 00555a8e9e9a381833a2530729887d70f3b946e2 Mon Sep 17 00:00:00 2001 From: Sahil Yeole Date: Fri, 20 Oct 2023 04:44:53 +0530 Subject: [PATCH] fix text selection Signed-off-by: Sahil Yeole --- flutter/lib/desktop/pages/connection_page.dart | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/flutter/lib/desktop/pages/connection_page.dart b/flutter/lib/desktop/pages/connection_page.dart index 0b15404ca..e714d979f 100644 --- a/flutter/lib/desktop/pages/connection_page.dart +++ b/flutter/lib/desktop/pages/connection_page.dart @@ -287,15 +287,10 @@ class _ConnectionPageState extends State if (fieldFocusNode.hasFocus && !isPeersLoading){ _fetchPeers(); } - // select all to facilitate removing text, just following the behavior of address input of chrome - SchedulerBinding.instance.addPostFrameCallback((_) { - final textLength = fieldTextEditingController.value.text.length; - Future.delayed(Duration(milliseconds: 150) , () { - fieldTextEditingController.selection = TextSelection.collapsed(offset: textLength); - fieldTextEditingController.selection = TextSelection(baseOffset: 0, extentOffset: textLength); - }); - }); }); + final textLength = fieldTextEditingController.value.text.length; + // select all to facilitate removing text, just following the behavior of address input of chrome + fieldTextEditingController.selection = TextSelection(baseOffset: 0, extentOffset: textLength); return Obx(() => TextField( maxLength: 90,