From c83df2686a06c644d8c0804ffe1cd75a88ca5d57 Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 5 Aug 2024 12:02:31 -0500 Subject: [PATCH] fix(mobile): autofill (#11591) --- mobile/lib/widgets/forms/login/login_form.dart | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mobile/lib/widgets/forms/login/login_form.dart b/mobile/lib/widgets/forms/login/login_form.dart index 0395bdcb28..4384879fce 100644 --- a/mobile/lib/widgets/forms/login/login_form.dart +++ b/mobile/lib/widgets/forms/login/login_form.dart @@ -2,6 +2,7 @@ import 'dart:io'; import 'package:auto_route/auto_route.dart'; import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; import 'package:flutter_hooks/flutter_hooks.dart' hide Store; import 'package:fluttertoast/fluttertoast.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; @@ -55,7 +56,7 @@ class LoginForm extends HookConsumerWidget { )..repeat(); final serverInfo = ref.watch(serverInfoProvider); final warningMessage = useState(null); - + final loginFormKey = GlobalKey(); final ValueNotifier serverEndpoint = useState(null); checkVersionMismatch() async { @@ -175,6 +176,7 @@ class LoginForm extends HookConsumerWidget { } login() async { + TextInput.finishAutofillContext(); // Start loading isLoading.value = true; @@ -478,7 +480,10 @@ class LoginForm extends HookConsumerWidget { // Note: This used to have an AnimatedSwitcher, but was removed // because of https://github.com/flutter/flutter/issues/120874 - serverSelectionOrLogin, + Form( + key: loginFormKey, + child: serverSelectionOrLogin, + ), ], ), ),