fix: remote id, update text and reserve selection (#10867)

Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
fufesou
2025-02-21 10:41:57 +08:00
committed by GitHub
parent 343f12b380
commit 0b9a6a280e
3 changed files with 21 additions and 5 deletions

View File

@@ -225,6 +225,7 @@ class _ConnectionPageState extends State<ConnectionPage>
}
});
}
Get.put<TextEditingController>(_idEditingController);
Get.put<IDTextEditingController>(_idController);
windowManager.addListener(this);
}
@@ -395,8 +396,8 @@ class _ConnectionPageState extends State<ConnectionPage>
FocusNode fieldFocusNode,
VoidCallback onFieldSubmitted,
) {
fieldTextEditingController.text = _idController.text;
Get.put<TextEditingController>(fieldTextEditingController);
updateTextAndPreserveSelection(
fieldTextEditingController, _idController.text);
return Obx(() => TextField(
autocorrect: false,
enableSuggestions: false,