Skip to content

Commit b2e54f4

Browse files
login: Assign SemanticsRole to Form
1 parent fd88648 commit b2e54f4

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

lib/widgets/login.dart

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import 'dart:async';
2+
import 'dart:ui';
23

34
import 'package:flutter/foundation.dart';
45
import 'package:flutter/material.dart';
@@ -648,18 +649,22 @@ class _UsernamePasswordFormState extends State<_UsernamePasswordForm> {
648649
selectedIcon: const Icon(Icons.visibility_off),
649650
)));
650651

651-
return Form(
652-
// TODO(#110) Try to highlight CZO / Zulip Cloud realms in autofill
653-
child: AutofillGroup(
654-
child: Column(mainAxisAlignment: MainAxisAlignment.center, children: [
655-
usernameField,
656-
const SizedBox(height: 8),
657-
passwordField,
658-
const SizedBox(height: 8),
659-
ElevatedButton(
660-
onPressed: widget.loginPageState._inProgress ? null : _submit,
661-
child: Text(zulipLocalizations.loginFormSubmitLabel)),
662-
])));
652+
return Semantics(
653+
role: SemanticsRole.form,
654+
container: true,
655+
explicitChildNodes: true,
656+
child: Form(
657+
// TODO(#110) Try to highlight CZO / Zulip Cloud realms in autofill
658+
child: AutofillGroup(
659+
child: Column(mainAxisAlignment: MainAxisAlignment.center, children: [
660+
usernameField,
661+
const SizedBox(height: 8),
662+
passwordField,
663+
const SizedBox(height: 8),
664+
ElevatedButton(
665+
onPressed: widget.loginPageState._inProgress ? null : _submit,
666+
child: Text(zulipLocalizations.loginFormSubmitLabel)),
667+
]))));
663668
}
664669
}
665670

0 commit comments

Comments
 (0)