Skip to content

[a11y][iOS] bottomNavigationBar cannot be navigated using Switch Control #160033

Closed

Description

@ChristianEdwardPadilla

Steps to reproduce

  1. Enable Switch Control in iOS settings app (https://support.apple.com/en-us/119835).
  2. Using the repro app below, attempt to navigate between NavigationDestinations within the NavigationBar.

Expected results

It is possible to navigate between NavigationDestination tabs.

Actual results

Focus seems to be stuck on a single NavigationDestination tab.

Code sample

Code sample
import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData(useMaterial3: false),
      title: 'Flutter Demo',
      home: MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key? key, required this.title}) : super(key: key);

  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;
  int _selectedIndex = 0;

  void _incrementCounter() {
    setState(() {
      _counter++;
    });
  }

  void _changeIndex(int index) {
    setState(() {
      _selectedIndex = index;
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title, style: TextStyle(fontFamily: 'ProductSans')),
      ),
      body: Center(
        child: Column(
          children: [
            Text(
              'Button tapped $_counter time${_counter == 1 ? '' : 's'}.',
              // This optional key is used to uniquely identify this widget in
              // the integration test at: test_driver/tap_test.dart.
              key: Key('CountText'),
              style: TextStyle(fontSize: 24),
            ),
            MaterialButton(
              onPressed: () {
                print('Button tapped');
              },
              color: Colors.blue,
              child: Text('Test button 1'),
            ),
            MaterialButton(
              onPressed: () {
                print('Button tapped');
              },
              color: Colors.blue,
              child: Text('Test button 2'),
            ),
            MaterialButton(
              onPressed: () {
                print('Button tapped');
              },
              color: Colors.blue,
              child: Text('Test button 3'),
            ),
          ],
        ),
      ),
      bottomNavigationBar: NavigationBar(
        onDestinationSelected: (index) {
          print('Selected destination $index');
          _incrementCounter();
          _changeIndex(index);
        },
        selectedIndex: _selectedIndex,
        destinations: [
          NavigationDestination(label: 'one', icon: Icon(Icons.home)),
          NavigationDestination(label: 'two', icon: Icon(Icons.home)),
          NavigationDestination(label: 'three', icon: Icon(Icons.home)),
        ],
      ),
    );
  }
}

Screenshots or Video

Video demonstration
IMG_4624.MP4

Logs

No response

Flutter Doctor output

Doctor output
[✓] Flutter (Channel google3)
    • Framework revision 1d60fc7843 (2 days ago), 2024-12-08T00:00:00.000
    • Engine revision 82d7c1b2c2
    • Dart version c7e47c6c5d

[✓] Xcode - develop for iOS and macOS (Xcode 16.0)
    • Xcode at /Applications/Xcode_16.0.0.app/Contents/Developer
    • Build 16A242d

Google bug tracker: b/382363824.

Activity

  1. maheshj01 commented on Dec 11, 2024

    @maheshj01
    Member

    Seems related to #139235, #44077

  2. danagbemava-nc commented on Dec 11, 2024

    @danagbemava-nc
    Member

    Reproducible using the steps outlined above.

    flutter doctor -v
    [✓] Flutter (Channel stable, 3.24.5, on macOS 15.1.1 24B91 darwin-arm64, locale en-US)
        • Flutter version 3.24.5 on channel stable at /Users/deanli/dev/stable
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision dec2ee5c1f (4 weeks ago), 2024-11-13 11:13:06 -0800
        • Engine revision a18df97ca5
        • Dart version 3.5.4
        • DevTools version 2.37.3
    
    [!] Flutter (Channel master, 3.27.0-1.0.pre.778, on macOS 15.1.1 24B91 darwin-arm64, locale en-US)
        • Flutter version 3.27.0-1.0.pre.778 on channel master at /Users/deanli/dev/master
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 9c86062f94 (5 hours ago), 2024-12-10 22:03:41 -0500
        • Engine revision a8f7556472
        • Dart version 3.7.0 (build 3.7.0-232.0.dev)
        • DevTools version 2.41.0
    
  3. added
    platform-iosiOS applications specifically
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    team-accessibilityOwned by Framework Accessibility team (i.e. responsible for accessibility code in flutter/flutter)
    p: material_uimaterial_ui package in flutter/packages
    f: focusFocus traversal, gaining or losing focus
    and removed
    in triagePresently being triaged by the triage team
    on Dec 11, 2024
  4. added
    P1High-priority issues at the top of the work list
    fyi-iosFor the attention of iOS platform team
    on Dec 12, 2024
  5. added
    r: fixedIssue is closed as already fixed in a newer version
    on Feb 4, 2025
  6. github-actions commented on Feb 18, 2025

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  7. locked as resolved and limited conversation to collaborators on Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority issues at the top of the work lista: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)customer: googleVarious Google teamsf: focusFocus traversal, gaining or losing focusfound in release: 3.24Found to occur in 3.24found in release: 3.27Found to occur in 3.27has reproducible stepsThe issue has been confirmed reproducible and is ready to work onp: material_uimaterial_ui package in flutter/packagesplatform-iosiOS applications specificallyr: fixedIssue is closed as already fixed in a newer versionteam-accessibilityOwned by Framework Accessibility team (i.e. responsible for accessibility code in flutter/flutter)triaged-accessibilityTriaged by Framework Accessibility team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions