Skip to content

BottomNavigationBar traversal order unintuitive #14375

Closed

Description

@goderbauer

(reported on iOS, most likely also affect Android)

  • bottom nav items should be listed as buttons and should clarify how many total tabs there are (ex: tab 1 of 3)
  • traversal order: when linearly swiping to the bottom buttons, focus starts on the second item "bar" instead of the first one "foo". regardless of 3-5 buttons on the bottom, i cant swipe to the first foo button, if you select the baz/doge buttons, linear swipe order and correct focus isn't preserved
  • when a bottom nav item is selected, the blue color is the only indication of which one is selected, needs announcment
  • using switch access - if a user selects an element, focus is then placed back at the top of the page, causing navigation issues

Activity

  1. goderbauer commented on Mar 6, 2018

    @goderbauer
    MemberAuthor

    @yjbanov This is a good example where our traversal order is way off on iOS:

    import 'package:flutter/material.dart';
    
    void main() => runApp(new MyApp());
    
    class MyApp extends StatelessWidget {
      // This widget is the root of your application.
      @override
      Widget build(BuildContext context) {
        return new MaterialApp(
          title: 'Flutter Demo',
          theme: new ThemeData(
            primarySwatch: Colors.blue,
          ),
          home: new BottomNavDemo(),
        );
      }
    }
    
    class BottomNavDemo extends StatefulWidget {
      @override
      State<BottomNavDemo> createState() {
        return new _BottomNavDemoState();
      }
    }
    
    class _BottomNavDemoState extends State<BottomNavDemo> {
      // The current page we're looking at.
      int currentPageIndex = 0;
    
      // How many pages from `pageTitles` we show.
      int shownPages = 5;
    
      List<String> pageTitles = <String>['Foo', 'Bar', 'Baz', 'Doge', 'Pupper'];
    
      // The minimum number of pages we'll show.
      static const minPages = 3;
      static const padding = const Padding(
        padding: const EdgeInsets.symmetric(vertical: 8.0),
      );
    
      @override
      Widget build(BuildContext context) {
        return new Scaffold(
          appBar: new AppBar(
            title: new Text(
              'Bottom Navigation',
              style: Theme.of(context).textTheme.title,
            ),
            elevation: 0.0,
            backgroundColor: Colors.white,
          ),
          bottomNavigationBar: new BottomNavigationBar(
            items: _buildItems(context),
            type: BottomNavigationBarType.fixed,
            currentIndex: currentPageIndex,
            onTap: _selectPage,
          ),
          body: new Center(
            child: new Text('Page ${pageTitles[currentPageIndex]}'),
          ),
        );
      }
    
      List<BottomNavigationBarItem> _buildItems(BuildContext context) {
        return pageTitles.take(shownPages).map((pageTitle) {
          return new BottomNavigationBarItem(
            icon: new Icon(Icons.star),
            title: new Text(pageTitle),
            backgroundColor: Colors.white,
          );
        }).toList();
      }
    
      void _selectPage(int value) {
        setState(() {
          currentPageIndex = value;
        });
      }
    }
  2. goderbauer commented on Mar 6, 2018

    @goderbauer
    MemberAuthor

    @gspencergoog The out-of-the-box computed traversal order for Android also fails on this one: If the middle tab of 5 (number 3) is selected, the computed order is Tab 1, 2, 4, 5, 3. This looks like something that should be out-of-the-box correct without requiring fine tuning of traversal order.

  3. changed the title [-]BottomNavigationBar is not accessible[/-] [+]BottomNavigationBar traversal order unintuitive[/+] on Apr 3, 2018
  4. self-assigned this
    on Apr 4, 2018
  5. modified the milestones: 3: Current Milestone, on Apr 11, 2018
  6. github-actions commented on Aug 16, 2021

    @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 Aug 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

a: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)from: a11y reviewReported by an accessibility review team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions