fix desktop dialog request focus

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages 2023-01-28 17:10:40 +08:00
parent 3e4a867115
commit 19f04f29c0
3 changed files with 7 additions and 5 deletions

View File

@ -608,12 +608,11 @@ class CustomAlertDialog extends StatelessWidget {
@override
Widget build(BuildContext context) {
FocusNode focusNode = FocusNode();
// request focus if there is no focused FocusNode in the dialog
Future.delayed(Duration.zero, () {
if (!focusNode.hasFocus) focusNode.requestFocus();
});
// request focus
FocusScopeNode scopeNode = FocusScopeNode();
Future.delayed(Duration.zero, () {
if (!scopeNode.hasFocus) scopeNode.requestFocus();
});
return FocusScope(
node: scopeNode,
autofocus: true,

View File

@ -666,6 +666,8 @@ Future<bool?> verificationCodeDialog(UserPayload? user) async {
child: const LinearProgressIndicator()),
],
),
onCancel: close,
onSubmit: onVerify,
actions: [
dialogButton("Cancel", onPressed: close, isOutline: true),
dialogButton("Verify", onPressed: onVerify),

View File

@ -653,6 +653,7 @@ class _RemoteMenubarState extends State<RemoteMenubar> {
));
}
if (pi.platform != kPeerPlatformAndroid &&
pi.platform != kPeerPlatformMacOS && // unsupport yet
version_cmp(peer_version, '1.2.0') >= 0) {
displayMenu.add(MenuEntryButton<String>(
childBuilder: (TextStyle? style) => Text(