fix: Autofillhints on readonly

This commit is contained in:
Christian Pauly 2021-02-01 21:39:34 +01:00
parent d553685dea
commit baafebb5f9
3 changed files with 6 additions and 4 deletions

View File

@ -180,7 +180,7 @@ class _LoginState extends State<Login> {
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<Login> {
child: TextField(
readOnly: loading,
autocorrect: false,
autofillHints: [AutofillHints.password],
autofillHints: loading ? null : [AutofillHints.password],
controller: passwordController,
obscureText: !showPassword,
onSubmitted: (t) => login(context),

View File

@ -92,10 +92,11 @@ class _SignUpState extends State<SignUp> {
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,

View File

@ -148,9 +148,10 @@ class _SignUpPasswordState extends State<SignUpPassword> {
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: '****',