Skip to content

[Accessibility] SliverResizingHeader captures semantic focus before list is fully scrolled #179687

@zemanux

Description

@zemanux

Links

This issue is similar to #179022 and will be fixed once PR #179023 is merged.

FYI @Renzo-Olivares .

Steps to reproduce

  1. Enable accessibility services (TalkBack or VoiceOver) on the device.
  2. Open a screen containing a CustomScrollView with a SliverResizingHeader and a list of items (e.g., SliverList).
  3. Scroll down the list so that the top items are off-screen.
  4. Navigate backwards (swipe left / previous item gesture) to scroll up toward the top of the list.

Expected results

The list should be fully scrolled to the top (displaying the very first item) before the semantic focus moves to the widget preceding the list or the pinned header. The user should be able to navigate through all remaining list items before leaving the list context.

Actual results

The PinnedHeaderSliver takes the semantic focus immediately when navigating up, effectively "skipping" the remaining items at the top of the list or preventing the list from scrolling all the way back to the start.

Code sample

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

void main() => runApp(const MaterialApp(home: MyApp()));

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: CustomScrollView(
        slivers: <Widget>[
          const SliverAppBar(
            pinned: true,
            expandedHeight: 100.0,
            title: Text('Sample App'),
            backgroundColor: Colors.blue,
          ),
          const SliverResizingHeader(
            minExtentPrototype: SizedBox(height: 50),
            maxExtentPrototype: SizedBox(height: 150),
            child: ColoredBox(
              color: Colors.green,
              child: ListTile(title: Text('Resizable Header')),
            ),
          ),
          // The List
          SliverList(
            delegate: SliverChildBuilderDelegate((BuildContext context, int index) {
              return ListTile(title: Text('Item $index'), subtitle: const Text('Scroll down then navigate back up'));
            }, childCount: 50),
          ),
        ],
      ),
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration
sliver_resizing_header.mp4

Flutter Doctor output

Doctor output
[✓] Flutter (Channel master, 3.40.0-1.0.pre-105, on macOS 15.7.2 24G325 darwin-arm64, locale fr-FR) [4,7s]
    • Flutter version 3.40.0-1.0.pre-105 on channel master at /Users/emmanuel_lefebvre/fvm/versions/master
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 6519f99911 (10 hours ago), 2025-12-10 00:18:27 -0500
    • Engine revision 6519f99911
    • Dart version 3.11.0 (build 3.11.0-227.0.dev)
    • DevTools version 2.53.0
    • Pub download mirror https://artifact.socrate.vsct.fr/artifactory/api/pub/all-pub
    • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations,
      enable-native-assets, omit-legacy-version-file, enable-lldb-debugging, enable-uiscene-migration

[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.1) [4,5s]
    • Android SDK at /Users/emmanuel_lefebvre/Library/Android/sdk
    • Emulator version 36.2.12.0 (build_id 14214601) (CL:N/A)
    • Platform android-36, build-tools 35.0.1
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
      This is the JDK bundled with the latest Android Studio installation on this machine.
      To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version OpenJDK Runtime Environment (build 21.0.8+-14196175-b1038.72)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 26.1.1) [3,8s]
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 17B100
    • CocoaPods version 1.16.2

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

[✓] Connected device (3 available) [14,3s]    
    • sdk gphone64 arm64 (mobile) • emulator-5554 • android-arm64  • Android 15 (API 35) (emulator)
    • macOS (desktop)             • macos         • darwin-arm64   • macOS 15.7.2 24G325 darwin-arm64
    • Chrome (web)                • chrome        • web-javascript • Google Chrome 143.0.7499.41

[✓] Network resources [581ms]
    • All expected network resources are available.

• No issues found!

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)f: focusFocus traversal, gaining or losing focusf: material designflutter/packages/flutter/material repository.f: scrollingViewports, list views, slivers, etc.found in release: 3.38Found to occur in 3.38found in release: 3.40Found to occur in 3.40frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onteam-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