Repository navigation
Closed
Closed
Copy link
Labels
assigned for triageissue is assigned to a domain expert for further triageissue is assigned to a domain expert for further triagebrowser: safari-macosonly manifests in Safari on macOSonly manifests in Safari on macOSf: scrollingViewports, list views, slivers, etc.Viewports, list views, slivers, etc.found in release: 1.24Found to occur in 1.24Found to occur in 1.24frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onplatform-iosiOS applications specificallyiOS applications specificallyplatform-webWeb applications specificallyWeb applications specificallyr: duplicateIssue is closed as a duplicate of an existing issueIssue is closed as a duplicate of an existing issue
Description
Steps to Reproduce
- Create new Flutter project
- Copy and paste code below in the main.dart
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity,
),
home: Scaffold(
body: ListView.builder(
itemBuilder: (context, index) => Container(
child: Text('$index'),
),
itemCount: 1000,
),
),
);
}
}
- Run
flutter run -d web-server --web-port 8080 - Open iOS simulator and go to
localhost:8080 - Scroll the list
Expected results:
iOS's Safari should hide the url bar (top bar) and the navigation bar (bottom bar) while scrolling.
Actual results:
iOS's Safari does not hide both the url bar and navigation bar
Logs
Analyzing safari_scroll_bug...
No issues found! (ran in 2.4s)
[✓] Flutter (Channel beta, 1.22.1, on Mac OS X 10.15.7 19H2, locale en-JP)
• Flutter version 1.22.1 at /Users/panuavakul/Frameworks/flutter
• Framework revision f30b7f4db9 (2 weeks ago), 2020-10-08 10:06:30 -0700
• Engine revision 75bef9f6c8
• Dart version 2.10.1
[✗] Android toolchain - develop for Android devices
✗ Unable to locate Android SDK.
Install Android Studio from: https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK components.
(or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).
If the Android SDK has been installed to a custom location, set ANDROID_SDK_ROOT to that location.
You may also want to add it to your PATH environment variable.
[✓] Xcode - develop for iOS and macOS (Xcode 11.7)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.7, Build version 11E801a
• CocoaPods version 1.9.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[!] Android Studio (not installed)
• Android Studio not found; download from https://developer.android.com/studio/index.html
(or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).
[✓] VS Code (version 1.50.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.15.1
[✓] Connected device (3 available)
• iPhone SE (2nd generation) (mobile) • 5CB0F884-F448-4A74-9D58-75FC3B8BD51D • ios • com.apple.CoreSimulator.SimRuntime.iOS-13-7 (simulator)
• Web Server (web) • web-server • web-javascript • Flutter Tools
• Chrome (web) • chrome • web-javascript • Google Chrome 86.0.4240.111
Reacted by Jose Tapizquent and Matthias Bauchinger
Metadata
Metadata
Assignees
Labels
assigned for triageissue is assigned to a domain expert for further triageissue is assigned to a domain expert for further triagebrowser: safari-macosonly manifests in Safari on macOSonly manifests in Safari on macOSf: scrollingViewports, list views, slivers, etc.Viewports, list views, slivers, etc.found in release: 1.24Found to occur in 1.24Found to occur in 1.24frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onplatform-iosiOS applications specificallyiOS applications specificallyplatform-webWeb applications specificallyWeb applications specificallyr: duplicateIssue is closed as a duplicate of an existing issueIssue is closed as a duplicate of an existing issue
Activity
[-]Flutter for Web does not hide url bar and navigation bar on scroll in Safari[/-][+]Flutter for Web does not hide url bar and navigation bar on scroll in iOS's Safari[/+]darshankawar commentedon Oct 23, 2020
@panuavakul
Can you upgrade to latest beta, try again and also share video of the issue.
clay4649 commentedon Oct 23, 2020
Hey thanks, just upgraded to the latest beta
Here is a video of the issue
I believe the normal behavior of Safari is that it will hide the url bar and the navigation bar when scrolling.
darshankawar commentedon Oct 26, 2020
Googling
Fluttersearch results on iOS safari browser ans scrolling the results does hide the nav and url bar, but the same isn't happening when using Flutter web. Keeping this issue open for further analysis.flutter doctor -v
jamesblasco commentedon Nov 1, 2020
Hello @yjbanov, here is some research I have been doing related to this problem:
The safari mobile WebKit uses the body scroll to handle this interaction. This requires the body
overflow-yattribute to be set toauto/scrolland the body to have a size longer than 100%. Obviously, this is not the case for any flutter web as by default overflow ishidden.After changing that I couldn't make it work programmatically by calling
window.scrollTo(...)orwindowScroll(). Only user manual drag worked.By overriding, some of the default CSS attributes added by the flutter framework I manage to hide the bars. But also it broke most of the hitTest inside the flutter framework.
I also couldn't remove the scrollbar that appears after making these changes.
You have the demo here: https://jamesblasco.github.io/flutter-web-scroll/
You can add this to the
<head>of theindex.hmlfile of any flutter project and try it also there.yjbanov commentedon Dec 4, 2020
Deduplicating with #69529
satishtravelstart commentedon Jun 9, 2021
Hi jamesblasco,
The aforementioned code only works in the Non Scrollview and Listview cases, however when we use Listview or Scrollview in Dart, the material does not scroll as intended.
github-actions commentedon Jul 31, 2021
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 -vand a minimal reproduction of the issue.