fix text selection
Signed-off-by: Sahil Yeole <sahilyeole93@gmail.com>
This commit is contained in:
parent
e8c4615ff6
commit
00555a8e9e
@ -287,15 +287,10 @@ class _ConnectionPageState extends State<ConnectionPage>
|
|||||||
if (fieldFocusNode.hasFocus && !isPeersLoading){
|
if (fieldFocusNode.hasFocus && !isPeersLoading){
|
||||||
_fetchPeers();
|
_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(() =>
|
return Obx(() =>
|
||||||
TextField(
|
TextField(
|
||||||
maxLength: 90,
|
maxLength: 90,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user