Skip to content

Not able to navigate using tab key when using nested Navigators #109624

@eduardoGo

Description

@eduardoGo

I'm not able to navigate using tab key when using nested Navigators, see the minimal reproducible code.

Steps to Reproduce

  1. Execute flutter run on the code sample
  2. Use tab key to navigate between widgets

Expected results: You should be able to navigate in the entire widget tree

Actual results: You can't navigate to the app bar button, neither the widgets of the outer navigator.

Minimal reproducible code
import 'package:flutter/material.dart';

void main()  => runApp(MyApp());

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

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

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Navigator(
        pages: [
          MaterialPage(
            child: Scaffold(
              appBar: AppBar(
                leading: IconButton(
                  icon: const Icon(Icons.menu),
                  onPressed: () {},
                ),
              ),
              body: Row(
                children: [
                  TextButton(
                    onPressed: () {},
                    child: const Text('Menu button 1'),
                  ),
                  Expanded(
                    child: Navigator(
                      pages: [
                        MaterialPage(
                          child: Column(
                            children: [
                              TextButton(
                                onPressed: () {},
                                child: const Text('Body button 1'),
                              ),
                              TextButton(
                                onPressed: () {},
                                child: const Text('Body button 2'),
                              ),
                            ],
                          ),
                        ),
                      ],
                    ),
                  ),
                ],
              ),
            ),
          ),
        ],
      ),
    );
  }
}

Metadata

Metadata

Assignees

Labels

P0Critical issues such as a build break or regressiona: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)a: desktopRunning on desktopcustomer: googleVarious Google teamsframeworkflutter/packages/flutter repository. See also f: labels.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions