You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Scroll views with horzontal scroll axis should scroll by default without pressing shift when on desktop #83065
Hi @jeremiahlukus
This is not a regression, mouse drags are disabled by default #81569 but you can scroll using mouse
Since PageView is scrollable horizontally, you need to press Shift + Scroll. For the vertical list, you can just scroll as usual.
Run the code below, press Shift + Scroll
minimal code sample
/// Flutter code sample for PageView// Here is an example of [PageView]. It creates a centered [Text] in each of the three pages// which scroll horizontally.import'package:flutter/material.dart';
voidmain() =>runApp(constMyApp());
/// This is the main application widget.classMyAppextendsStatelessWidget {
constMyApp({Key? key}) :super(key: key);
staticconstString _title ='Flutter Code Sample';
@overrideWidgetbuild(BuildContext context) {
returnMaterialApp(
title: _title,
home:Scaffold(
appBar:AppBar(title:constText(_title)),
body:constMyStatelessWidget(),
),
);
}
}
/// This is the stateless widget that the main application instantiates.classMyStatelessWidgetextendsStatelessWidget {
constMyStatelessWidget({Key? key}) :super(key: key);
@overrideWidgetbuild(BuildContext context) {
finalPageController controller =PageController(initialPage:0);
returnPageView(
/// [PageView.scrollDirection] defaults to [Axis.horizontal]. /// Use [Axis.vertical] to scroll vertically.
scrollDirection:Axis.horizontal,
controller: controller,
children:const<Widget>[
Center(
child:Text('First Page'),
),
Center(
child:Text('Second Page'),
),
Center(
child:Text('Third Page'),
)
],
);
}
}
flutter doctor -v
[✓] Flutter (Channel master, 2.3.0-13.0.pre.87, on macOS 11.3.1 20E241 darwin-x64, locale en-GB) • Flutter version 2.3.0-13.0.pre.87 at /Users/tahatesser/Code/flutter_master • Upstream repository https://github.com/flutter/flutter.git • Framework revision 4d6a925326 (10 hours ago), 2021-05-21 01:09:02 -0400 • Engine revision 20260fb95f • Dart version 2.14.0 (build 2.14.0-134.0.dev)[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3) • Android SDK at /Volumes/Extreme/SDK • Platform android-30, build-tools 30.0.3 • ANDROID_HOME = /Volumes/Extreme/SDK • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264) • All Android licenses accepted.[✓] Xcode - develop for iOS and macOS • Xcode at /Volumes/Extreme/Xcode.app/Contents/Developer • Xcode 12.5, Build version 12E262 • CocoaPods version 1.10.1[✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome[✓] Android Studio (version 4.2) • 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.8+10-b944.6916264)[✓] IntelliJ IDEA Community Edition (version 2021.1.1) • IntelliJ at /Volumes/Extreme/IntelliJ IDEA CE.app • Flutter plugin version 55.1.5 • Dart plugin version 211.7233[✓] VS Code (version 1.56.2) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.22.0[✓] Connected device (3 available) • iPhone 12 (mobile) • D72A5DAA-24E6-421B-B4F5-7CFAFB498040 • ios • com.apple.CoreSimulator.SimRuntime.iOS-14-5 (simulator) • macOS (desktop) • macos • darwin-x64 • macOS 11.3.1 20E241 darwin-x64 • Chrome (web) • chrome • web-javascript • Google Chrome 90.0.4430.212• No issues found!
This might a side effect of this change, It think regular scroll should also scroll horizontal pageview without pressing shift on desktop
Yea seems odd to have to hold shift to drag on desktop very unintuitive. Thanks for pointing to the commit that gives me a place to look to overwrite this behavior
changed the title [-][dev channel] PageView on web broken[/-][+]Scroll views with horizontal scroll axis on desktop requires `shift` + scroll after desktop rejects drags by default[/+]on May 24, 2021
changed the title [-]Scroll views with horizontal scroll axis on desktop requires `shift` + scroll after desktop rejects drags by default[/-][+]Scroll views with horizontal scroll axis on desktop requires `shift` + scroll after desktop mouse rejects drags by default[/+]on May 24, 2021
changed the title [-]Scroll views with horizontal scroll axis on desktop requires `shift` + scroll after desktop mouse rejects drags by default[/-][+]Scroll views with horzontal scroll axis should scroll by default without pressing `shift` when on desktop[/+]on May 26, 2021
This issue tracks horizontal scroll requiring shift +scroll on desktop, which adds an extra step to scroll.
Changing the title to better address the solution
This is as designed. Shift+scroll wheel is the standard for horizontal scrolling on desktop applications, even when only horizontal scrolling is available.
If we changed it as you suggest, then nested scroll views would act very strangely: think of a horizontal scroll inside of a vertical scroll: when the vertical scroll reached the end, it would start scrolling horizontally.
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 -v and a minimal reproduction of the issue.
Activity
TahaTesser commentedon May 21, 2021
Hi @jeremiahlukus
This is not a regression, mouse drags are disabled by default #81569 but you can scroll using mouse
Since PageView is scrollable horizontally, you need to press
Shift+ Scroll. For the vertical list, you can just scroll as usual.Run the code below, press
Shift+ Scrollminimal code sample
flutter doctor -v
This might a side effect of this change, It think regular scroll should also scroll horizontal pageview without pressing shift on desktop
jeremiahlukus commentedon May 21, 2021
Yea seems odd to have to hold shift to drag on desktop very unintuitive. Thanks for pointing to the commit that gives me a place to look to overwrite this behavior
[-][dev channel] PageView on web broken[/-][+]Scroll views with horizontal scroll axis on desktop requires `shift` + scroll after desktop rejects drags by default[/+][-]Scroll views with horizontal scroll axis on desktop requires `shift` + scroll after desktop rejects drags by default[/-][+]Scroll views with horizontal scroll axis on desktop requires `shift` + scroll after desktop mouse rejects drags by default[/+][-]Scroll views with horizontal scroll axis on desktop requires `shift` + scroll after desktop mouse rejects drags by default[/-][+]Scroll views with horzontal scroll axis should scroll by default without pressing `shift` when on desktop[/+]TahaTesser commentedon May 26, 2021
This issue tracks horizontal scroll requiring
shift+scroll on desktop, which adds an extra step to scroll.Changing the title to better address the solution
gspencergoog commentedon May 27, 2021
This is as designed. Shift+scroll wheel is the standard for horizontal scrolling on desktop applications, even when only horizontal scrolling is available.
If we changed it as you suggest, then nested scroll views would act very strangely: think of a horizontal scroll inside of a vertical scroll: when the vertical scroll reached the end, it would start scrolling horizontally.
github-actions commentedon Aug 1, 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.