Skip to content

a11y focus moves randomly in GridView with many children.  #61631

@mehmetf

Description

@mehmetf

b/161434746

During the navigation in GridView, when GridView is scrolled by swiping, it is likely that A11y focus will jump randomly in the page. The black border indicates A11y focus will disappear sometimes.

import 'package:flutter/material.dart';

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

class A11yApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    final appBar =
    AppBar(title: const Icon(Icons.archive));

    return MaterialApp(
      home: Scaffold(
        appBar: appBar,
        body: SingleChildScrollView(
          child: Column(
            children: [_buildGridView(), _buildGridView(), _buildGridView()],
          ),
        ),
      ),
    );
  }

  Widget _buildGridView() {
    return Column(
      children: [
        const Text('Grid header'),
        GridView.count(
          shrinkWrap: true,
          crossAxisSpacing: 10,
          mainAxisSpacing: 10,
          crossAxisCount: 2,
          children: <Widget>[
            for (var i = 0; i < 50; ++i)
              Container(
                padding: const EdgeInsets.all(8),
                color: Colors.green[100],
                child: Text('Number $i'),
              ),
          ],
        ),
      ],
    );
  }
}

This is blocking release due to a11y review. See internal bug for videos on the behavior.

Metadata

Metadata

Assignees

Labels

P0Critical issues such as a build break or regressiona: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)customer: money (g3)f: scrollingViewports, list views, slivers, etc.found in release: 1.21Found to occur in 1.21frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-iosiOS applications specificallywaiting for PR to land (fixed)A fix is in flight

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions