Skip to content

Accessibility Focus jumps to Scaffold's AppBar while trying to swipe down or up in a listview #98572

Open

Description

@Danyalo

General info

The issue is observed in Flutter versions 2.5.3 and 2.8.1.
The issue manifests a bit differently on Android and iOS.
The issue is observed on all iOS versions 15.x, up to the current 15.3.1. I could not test the issue on previous versions due to lack of devices.
This issue is observed on Android version 12. On Android 10, the behaviour is more or less as expected.

Steps to Reproduce

  1. Create a new Flutter app with flutter create and paste the Code sample provided below in the main.dart file
  2. Run a project on a real device
  3. On iOS: Turn on a VoiceOver accessibility feature (if not already configured, VoiceOver can be turned on via a shortcut. To configure, go to Settings -> Accessibility -> Accessibility Shortcut)
    OR
    On Android: Turn on TalkBack (if not already configured, TalkBack can be turned on via a shortcut. To configure, go to Settings -> Accessibility -> TalkBack -> TalkBack Shortcut)
  4. Select an element from the list with accessibility focus
  5. Scroll the list with 3-fingers-swipe gesture on iOS or 2-fingers-swipe on Android
  6. Observe what happens when the selected element moves out of the screen as you focus

NOTE: This issue is observed when scrolling upwards as well as downwards. It is also observed when using horizontal lists.

Expected results:

The focus navigates to the next elements of the screen gracefully like in popular apps, e.g. YouTube app.
Please check the attached behaviour of native Youtube app on iPad for a clear example.
Alternatively, it at least stays focused on the list and does not jump to appBar widget abruptly.

Actual results:

On iOS, the focus jumps to Scaffold's AppBar as soon as it leaves the viewport of the screen.
On Android, the focus disappears completely. If the user chooses to move the focus to the next element via Swipe Right gesture, AppBar is selected.
Alternatively, some people reported a bit different behaviour for Android: the focus stays on the list element until it is moved away from the phone's screen, even if the list's viewport is much smaller (e.g. there's big padding around the list). I could not reproduce this behaviour myself, therefore I will not provide a specific Code sample with paddings. The bottom line is, a11y focus behaviour is inconsistent in lists on Android 12 platform.

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

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

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({
    Key? key,
  }) : super(key: key);

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  final items = List<String>.generate(1000, (i) => 'Item $i');

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Flutter Demo Home Page'),
      ),
      body: Center(
        child: ListView.builder(
          itemCount: items.length,
          itemBuilder: (context, index) {
            return ListTile(
              title: Text(items[index]),
            );
          },
        ),
      ),
    );
  }
}
Logs

Running the app with flutter run --verbose did not provide any non-trivial information.

Running flutter analyze yields

Analyzing myapp...                                              
No issues found! (ran in 0.8s)

flutter doctor -v output:

[✓] Flutter (Channel stable, 2.5.3, on macOS 12.2 21D49 darwin-arm, locale en-GB)
    • Flutter version 2.5.3 at /Users/danya/fvm/versions/2.5.3
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 18116933e7 (4 months ago), 2021-10-15 10:46:35 -0700
    • Engine revision d3ea636dc5
    • Dart version 2.14.4

[✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
    • Android SDK at /Users/danya/Library/Android/sdk
    • Platform android-32, build-tools 32.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 13.2.1, Build version 13C100
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763)

[✓] VS Code (version 1.64.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.34.0

[✓] Connected device (3 available)
    • My iPad (mobile) • 00008020-0001386E3AA2402E • ios            • iOS 15.3.1 19D52
    • macOS (desktop)  • macos                     • darwin-arm64   • macOS 12.2 21D49 darwin-arm
    • Chrome (web)     • chrome                    • web-javascript • Google Chrome 98.0.4758.80

• No issues found!
iPad Screenshots

bug_1
bug_2

iPad Youtube App Behavior
voiceover_youtube.MP4

Activity

  1. darshankawar commented on Feb 17, 2022

    @darshankawar
    Member

    Verified this behavior on latest stable (2.10.1) and on latest master using iOS device and can replicate the behavior mentioned in the report.
    On latest stable, with voiceover ON and we select an item from the list and try to swipe up or down using three-finger swipe, the accessibility focus moves towards appbar, as shown below:

    RPReplay-Final1645079912.MP4

    As you can see in the video, after selecting an item from the list and trying to swipe, sometimes the accessibility focus is lost and other times, the focus shifts towards appbar.

    On latest master though, I was unable to select an item from the list to focus, as while trying to tap, the accessibility focus didn't work.

    Screenshot 2022-02-17 at 12 34 44 PM

    Also verified this behavior on Samsung S10 (Android 11) device and observed that selecting a list and then swiping using two-finger gesture works properly and focus doesn't shift towards appbar. Although I noticed, that while scrolling up, the accessibility focus overrides the appbar and shows up as transparent pass through. Hence, I am unable to replicate the same behavior on Android. Since I don't have Android 12 to verify this, I'll leave the issue status and label as-is.

    IMG-2223.mov
    stable, master flutter doctor -v
    
    [✓] Flutter (Channel stable, 2.10.1, on Mac OS X 10.15.4 19E2269 darwin-x64,
        locale en-GB)
        • Flutter version 2.10.1 at /Users/dhs/documents/fluttersdk/flutter
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision db747aa133 (5 days ago), 2022-02-09 13:57:35 -0600
        • Engine revision ab46186b24
        • Dart version 2.16.1
        • DevTools version 2.9.2
    
    [!] Xcode - develop for iOS and macOS (Xcode 12.3)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        ! Flutter recommends a minimum Xcode version of 13.
          Download the latest version or update via the Mac App Store.
        • CocoaPods version 1.11.2
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] VS Code (version 1.62.0)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.21.0
    
    [✓] Connected device (5 available)
        • SM G975F (mobile)       • RZ8M802WY0X • android-arm64   • Android 11 (API 30)
        • Darshan's iphone (mobile)  • 21150b119064aecc249dfcfe05e259197461ce23 •
          ios            • iOS 14.4.1 18D61
        • iPhone 12 Pro Max (mobile) • A5473606-0213-4FD8-BA16-553433949729     •
          ios            • com.apple.CoreSimulator.SimRuntime.iOS-14-3 (simulator)
        • macOS (desktop)            • macos                                    •
          darwin-x64     • Mac OS X 10.15.4 19E2269 darwin-x64
        • Chrome (web)               • chrome                                   •
          web-javascript • Google Chrome 98.0.4758.80
    
    [✓] HTTP Host Availability
        • All required HTTP hosts are available
    
    ! Doctor found issues in 1 category.
    
    
    [✓] Flutter (Channel master, 2.11.0-0.0.pre.598, on Mac OS X 10.15.4 19E2269
        darwin-x64, locale en-GB)
        • Flutter version 2.11.0-0.0.pre.598 at
          /Users/dhs/documents/fluttersdk/flutter
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 660c15ef7f (41 minutes ago), 2022-02-16 23:09:13 -0500
        • Engine revision 754478998b
        • Dart version 2.17.0 (build 2.17.0-105.0.dev)
        • DevTools version 2.10.0
    
    [!] Xcode - develop for iOS and macOS (Xcode 12.3)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        ! Flutter recommends a minimum Xcode version of 13.
          Download the latest version or update via the Mac App Store.
        • CocoaPods version 1.11.2
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] VS Code (version 1.62.0)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.21.0
    
    [✓] Connected device (5 available)
        • SM G975F (mobile)       • RZ8M802WY0X • android-arm64   • Android 11 (API 30)
        • Darshan's iphone (mobile)  • 21150b119064aecc249dfcfe05e259197461ce23 •
          ios            • iOS 14.4.1 18D61
        • iPhone 12 Pro Max (mobile) • A5473606-0213-4FD8-BA16-553433949729     •
          ios            • com.apple.CoreSimulator.SimRuntime.iOS-14-3 (simulator)
        • macOS (desktop)            • macos                                    •
          darwin-x64     • Mac OS X 10.15.4 19E2269 darwin-x64
        • Chrome (web)               • chrome                                   •
          web-javascript • Google Chrome 98.0.4758.80
    
    [✓] HTTP Host Availability
        • All required HTTP hosts are available
    
    ! Doctor found issues in 1 category.
    
    
    
  2. added
    a: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    a: qualityA truly polished experience
    frameworkflutter/packages/flutter repository. See also f: labels.
    p: material_uimaterial_ui package in flutter/packages
    customer: crowdAffects or could affect many people, though not necessarily a specific customer.
    and removed
    in triagePresently being triaged by the triage team
    on Feb 17, 2022
  3. changed the title [-]Accessibility Focus jumps to Scaffold's AppBar uncontrollably[/-] [+]Accessibility Focus jumps to Scaffold's AppBar while trying to swipe down or up in a listview[/+] on Feb 17, 2022
  4. darshankawar commented on Feb 17, 2022

    @darshankawar
    Member
  5. fryette commented on Jun 21, 2023

    @fryette

    Dear Flutter team. Can you please update when this issue can be resolved? This blocking our new fluter app from release because after migration from native android/iOS implementation to Flutter we are not able to deliver proper UX to users who need accessibility features in app.
    Thanks in advance!

  6. shcherbuk96 commented on Jul 5, 2023

    @shcherbuk96

    Dear @darshankawar @chunhtai
    Please, check the comment above

  7. 13 remaining items

  8. hannah-hyj commented on Nov 4, 2024

    @hannah-hyj
    Member

    A easy workaround: update the cacheExtent to a larger number like 1000.0.

    the current defaultCacheExtent is 250.0 (pixel) and it's smaller than screen height, so if you scroll to next item (1 finger swipe)it's fine but if you scroll to the next page (3 fingers scroll)sometimes it loses focus and it will focus to the app bar.

    When I was testing, if I update defaultCacheExtent from 250.0 to 1000.0 the issue is gone.

    The 250.0 is probably a eye-balled value before, but instead of updating the hard code value maybe we should also make it related to devices screen height? ( the OP mentioned they were testing on an ipad)

  9. self-assigned this
    on Oct 20, 2025
  10. flutter-triage-bot commented on Feb 23, 2026

    @flutter-triage-bot

    This issue is assigned to @chunhtai but has had no recent status updates. Please consider unassigning this issue if it is not going to be addressed in the near future. This allows people to have a clearer picture of what work is actually planned. Thanks!

  11. added
    ⏳Bot is counting down the days until it unassigns the issue
    on Feb 23, 2026
  12. flutter-triage-bot commented on May 12, 2026

    @flutter-triage-bot

    This issue was assigned to @chunhtai but has had no status updates in a long time. To remove any ambiguity about whether the issue is being worked on, the assignee was removed.

  13. removed
    ⏳Bot is counting down the days until it unassigns the issue
    on May 12, 2026
  14. self-assigned this
    on May 13, 2026
  15. added
    packageflutter/packages repository. See also p: labels.
    and removed
    frameworkflutter/packages/flutter repository. See also f: labels.
    on Aug 17, 2026
  16. zywek123 commented on Sep 22, 2026

    @zywek123

    @jmagman I’ve discovered that until Flutter sends scroll events correctly with a message—e.g. page 5 of 15—the VO will crash on the AppBar after a few consecutive scrolls.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work lista: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)a: qualityA truly polished experiencecustomer: crowdAffects or could affect many people, though not necessarily a specific customer.found in release: 2.10Found to occur in 2.10found in release: 2.11Found to occur in 2.11has reproducible stepsThe issue has been confirmed reproducible and is ready to work onp: material_uimaterial_ui package in flutter/packagespackageflutter/packages repository. See also p: labels.team-accessibilityOwned by Framework Accessibility team (i.e. responsible for accessibility code in flutter/flutter)

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions