Skip to content

[Web] button with autofocus doesn't gain accessibility focus automatically #118651

@nbayati

Description

@nbayati

Steps to Reproduce

  1. Run sample code on Chrome on desktop
  2. Enable accessibility
  3. Navigate to the next element using VoiceOver shortcuts.

Expected results: The element with autofocus needs to gain focus

Actual results: Can't navigate using VoiceOver unless exit web content and come back.

Code sample
void main(){
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<StatefulWidget> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) => MaterialApp(
        home: Center(
          child: Column(
            children: [
              TextButton(
                onPressed: () {},
                autofocus: true,
                child: const Text('Text 1'),
              ),
              TextButton(
                onPressed: () {},
                child: const Text('Text 2'),
              ),
              TextButton(
                onPressed: () {},
                child: const Text('Text 3'),
              ),
              TextButton(
                onPressed: () {},
                child: const Text('Text 4'),
              ),
              TextButton(
                onPressed: () {},
                child: const Text('Text 5'),
              ),
              TextButton(
                onPressed: () {},
                child: const Text('Text 6'),
              ),
            ],
          ),
        ),
      );
}

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work lista: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)customer: huggsy (g3)platform-webWeb applications specifically

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions