From baafebb5f92d80c589e6c184004936cb721a2dde Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Mon, 1 Feb 2021 21:39:34 +0100 Subject: [PATCH] fix: Autofillhints on readonly --- lib/views/login.dart | 4 ++-- lib/views/sign_up.dart | 3 ++- lib/views/sign_up_password.dart | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/views/login.dart b/lib/views/login.dart index bffb622c..7754d9be 100644 --- a/lib/views/login.dart +++ b/lib/views/login.dart @@ -180,7 +180,7 @@ class _LoginState extends State { autofocus: true, onChanged: (t) => _checkWellKnownWithCoolDown(t, context), controller: usernameController, - autofillHints: [AutofillHints.username], + autofillHints: loading ? null : [AutofillHints.username], decoration: InputDecoration( prefixIcon: Icon(Icons.account_box_outlined), hintText: @@ -194,7 +194,7 @@ class _LoginState extends State { child: TextField( readOnly: loading, autocorrect: false, - autofillHints: [AutofillHints.password], + autofillHints: loading ? null : [AutofillHints.password], controller: passwordController, obscureText: !showPassword, onSubmitted: (t) => login(context), diff --git a/lib/views/sign_up.dart b/lib/views/sign_up.dart index ceb83b66..1a8130cc 100644 --- a/lib/views/sign_up.dart +++ b/lib/views/sign_up.dart @@ -92,10 +92,11 @@ class _SignUpState extends State { Padding( padding: const EdgeInsets.symmetric(horizontal: 12.0), child: TextField( + readOnly: loading, autocorrect: false, controller: usernameController, onSubmitted: (s) => signUpAction(context), - autofillHints: [AutofillHints.newUsername], + autofillHints: loading ? null : [AutofillHints.newUsername], decoration: InputDecoration( prefixIcon: Icon(Icons.account_circle_outlined), hintText: L10n.of(context).username, diff --git a/lib/views/sign_up_password.dart b/lib/views/sign_up_password.dart index a6136c13..ec3ab52c 100644 --- a/lib/views/sign_up_password.dart +++ b/lib/views/sign_up_password.dart @@ -148,9 +148,10 @@ class _SignUpPasswordState extends State { controller: passwordController, obscureText: !showPassword, autofocus: true, + readOnly: loading, autocorrect: false, onSubmitted: (t) => _signUpAction(context), - autofillHints: [AutofillHints.newPassword], + autofillHints: loading ? null : [AutofillHints.newPassword], decoration: InputDecoration( prefixIcon: Icon(Icons.lock_outlined), hintText: '****',