mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-12-12 11:06:57 +00:00
fix, autocomplete, fill id field
Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
@@ -245,6 +245,12 @@ class _ConnectionPageState extends State<ConnectionPage> {
|
||||
inputFormatters: [IDTextInputFormatter()],
|
||||
);
|
||||
},
|
||||
onSelected: (option) {
|
||||
setState(() {
|
||||
_idController.id = option.id;
|
||||
FocusScope.of(context).unfocus();
|
||||
});
|
||||
},
|
||||
optionsViewBuilder: (BuildContext context, AutocompleteOnSelected<Peer> onSelected, Iterable<Peer> options) {
|
||||
double maxHeight = options.length * 50;
|
||||
maxHeight = maxHeight > 200 ? 200 : maxHeight;
|
||||
@@ -268,7 +274,7 @@ class _ConnectionPageState extends State<ConnectionPage> {
|
||||
)))
|
||||
: ListView(
|
||||
padding: EdgeInsets.only(top: 5),
|
||||
children: options.map((peer) => AutocompletePeerTile(idController: _idController, peer: peer)).toList(),
|
||||
children: options.map((peer) => AutocompletePeerTile(onSelect: () => onSelected(peer), peer: peer)).toList(),
|
||||
))))
|
||||
);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user