Skip to content

iOS tap status bar to scroll up doesn't work with CustomScrollView #92119

@jjoelson

Description

@jjoelson

Steps to Reproduce

  1. Create an app with sample code below
  2. Scroll down, and then attempt to scroll to the top by tapping the status bar

Expected results:

The CustomScrollView should be scrolled to the top.

Actual results:

  • If the scroll view is scrolling, then nothing happens
  • If the scroll view is not scrolling, then nothing happens on the first tap but it works on the second tap
  • If debugging, hot restarting the app causes the gesture to stop working entirely

See video:

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

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      home: Scaffold(
        body: CustomScrollView(
          slivers: [
            SliverAppBar(
              title: Text(
                'iOS Tap to Scroll up',
              ),
              pinned: true,
            ),
            SliverFillRemaining(
              hasScrollBody: false,
              child: Column(
                children: [
                  Colors.green,
                  Colors.red,
                  Colors.blue,
                  Colors.black,
                  Colors.white
                ]
                    .map(
                      (c) => Container(
                        height: 300,
                        color: c,
                      ),
                    )
                    .toList(),
              ),
            ),
          ],
        ),
      ),
    );
  }
}
Logs
$ flutter doctor -v
[✓] Flutter (Channel stable, 2.5.1, on macOS 11.6 20G165 darwin-x64, locale en-US)
    • Flutter version 2.5.1 at /Users/jonathan.joelson/repos/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision ffb2ecea52 (5 weeks ago), 2021-09-17 15:26:33 -0400
    • Engine revision b3af521a05
    • Dart version 2.14.2

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/jonathan.joelson/Library/Android/sdk
    • Platform android-30, build-tools 30.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
    • All Android licenses accepted.

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

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

[✓] Android Studio (version 4.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 1.8.0_242-release-1644-b3-6915495)

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

[✓] Connected device (3 available)
    • Pixel 4a (mobile)  • 0B201JEC221560                       • android-arm64  • Android 11 (API 30)
    • iPhone 13 (mobile) • 790573B6-26D3-4BB5-A18B-087D763036DF • ios            • com.apple.CoreSimulator.SimRuntime.iOS-15-0 (simulator)
    • Chrome (web)       • chrome                               • web-javascript • Google Chrome 94.0.4606.81

• No issues found!

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: fidelityMatching the OEM platforms betterf: scrollingViewports, list views, slivers, etc.found in release: 2.5Found to occur in 2.5found in release: 2.6Found to occur in 2.6frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-iosiOS applications specificallyteam-iosOwned by iOS platform teamtriaged-iosTriaged by iOS platform team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions