a workaround of issue #2886, following the behavior address input of
chrome
This commit is contained in:
parent
f4d0305242
commit
87de9eb726
@ -419,7 +419,10 @@ class _PeerSearchBarState extends State<PeerSearchBar> {
|
|||||||
Widget _buildSearchBar() {
|
Widget _buildSearchBar() {
|
||||||
RxBool focused = false.obs;
|
RxBool focused = false.obs;
|
||||||
FocusNode focusNode = FocusNode();
|
FocusNode focusNode = FocusNode();
|
||||||
focusNode.addListener(() => focused.value = focusNode.hasFocus);
|
focusNode.addListener(() {
|
||||||
|
focused.value = focusNode.hasFocus;
|
||||||
|
peerSearchTextController.selection = TextSelection(baseOffset: 0, extentOffset: peerSearchTextController.value.text.length);
|
||||||
|
});
|
||||||
return Container(
|
return Container(
|
||||||
width: 120,
|
width: 120,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
|
@ -64,6 +64,8 @@ class _ConnectionPageState extends State<ConnectionPage>
|
|||||||
});
|
});
|
||||||
_idFocusNode.addListener(() {
|
_idFocusNode.addListener(() {
|
||||||
_idInputFocused.value = _idFocusNode.hasFocus;
|
_idInputFocused.value = _idFocusNode.hasFocus;
|
||||||
|
// select all to faciliate removing text, just following the behavior of address input of chrome
|
||||||
|
_idController.selection = TextSelection(baseOffset: 0, extentOffset: _idController.value.text.length);
|
||||||
});
|
});
|
||||||
windowManager.addListener(this);
|
windowManager.addListener(this);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user