Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add note on drag scrolling with mouse to 'Create a horizontal list' page #9378

Closed
2 tasks done
thcbk opened this issue Sep 9, 2023 · 12 comments · Fixed by #9960
Closed
2 tasks done

Add note on drag scrolling with mouse to 'Create a horizontal list' page #9378

thcbk opened this issue Sep 9, 2023 · 12 comments · Fixed by #9960
Labels
a.cookbook Relates to a cookbook recipe or guide cl.fixed Issue is closed as fixed d.enhancement Improves docs with specific ask e1-hours Effort: < 8 hrs fix.bug Needs fix of incorrect copy, code, or visual from.flutter-sdk Reported via move from flutter/flutter p2-medium Necessary but not urgent concern. Resolve when possible. t.desktop Relates to desktop compatibility of an app t.ui.scrolling Relates to a scrolling UI widget

Comments

@thcbk
Copy link

thcbk commented Sep 9, 2023

Is there an existing issue for this?

Steps to reproduce

  1. Go to https://docs.flutter.dev/cookbook/lists/horizontal-list
  2. Run the example

Expected results

The list should be scrollable horizontally

Actual results

The list can't be scrolled

Code sample

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

void main() => runApp(const MyApp());

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

  @override
  Widget build(BuildContext context) {
    const title = 'Horizontal List';

    return MaterialApp(
      title: title,
      home: Scaffold(
        appBar: AppBar(
          title: const Text(title),
        ),
        body: Container(
          margin: const EdgeInsets.symmetric(vertical: 20),
          height: 200,
          child: ListView(
            // This next line does the trick.
            scrollDirection: Axis.horizontal,
            children: <Widget>[
              Container(
                width: 160,
                color: Colors.red,
              ),
              Container(
                width: 160,
                color: Colors.blue,
              ),
              Container(
                width: 160,
                color: Colors.green,
              ),
              Container(
                width: 160,
                color: Colors.yellow,
              ),
              Container(
                width: 160,
                color: Colors.orange,
              ),
            ],
          ),
        ),
      ),
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
[√] Flutter (Channel stable, 3.10.2, on Microsoft Windows [Version 10.0.19045.3208], locale en-US)
    • Flutter version 3.10.2 on channel stable at D:\SET_UP\Flutter\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 9cd3d0d9ff (4 months ago), 2023-05-23 20:57:28 -0700
    • Engine revision 90fa3ae28f
    • Dart version 3.0.2
    • DevTools version 2.23.1

[√] Windows Version (Installed version of Windows is version 10 or higher)

[X] Android toolchain - develop for Android devices
    X 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/windows#android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.


[√] Chrome - develop for the web
    • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[X] Visual Studio - develop for Windows
    X Visual Studio not installed; this is necessary for Windows development.
      Download at https://visualstudio.microsoft.com/downloads/.
      Please install the "Desktop development with C++" workload, including all of its default components

[!] 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/windows#android-setup for detailed instructions).

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.19045.3208]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 116.0.5845.180
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 115.0.1901.200

[√] Network resources
    • All expected network resources are available.

! Doctor found issues in 3 categories.
@Oliinyk-Volodymyr
Copy link

I couldn't reproduce the described issue

@Mairramer
Copy link

The problem appears to be only on the web, perhaps on the desktop (needs testing).

@Karthikeyanarla
Copy link

@thcbk
I was able to scroll the list.
Increase the number of containers to 12 or above, or decrease the screen size.

@Mairramer
Copy link

Mairramer commented Sep 10, 2023

@Karthikeyanarla @thcbk The problem seems to occur when the page is not responsive.

Gravacao.de.Tela.2023-09-10.as.10.33.03.mov

@darshankawar
Copy link
Member

Thanks for the report. I was able to replicate the reported behavior on desktop and web platforms, as running the example code as-is doesn't let you scroll. After adding more Container items still doesn't scroll.
It works well on mobile platform.

stable, master flutter doctor -v
[!] Flutter (Channel stable, 3.13.2, on macOS 12.2.1 21D62 darwin-x64, locale
    en-GB)
    • Flutter version 3.13.2 on channel stable at
      /Users/dhs/documents/fluttersdk/flutter
    ! Warning: `flutter` on your path resolves to
      /Users/dhs/Documents/Fluttersdk/flutter/bin/flutter, which is not inside
      your current Flutter SDK checkout at
      /Users/dhs/documents/fluttersdk/flutter. Consider adding
      /Users/dhs/documents/fluttersdk/flutter/bin to the front of your path.
    ! Warning: `dart` on your path resolves to
      /Users/dhs/Documents/Fluttersdk/flutter/bin/dart, which is not inside your
      current Flutter SDK checkout at /Users/dhs/documents/fluttersdk/flutter.
      Consider adding /Users/dhs/documents/fluttersdk/flutter/bin to the front
      of your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision ff5b5b5fa6 (7 days ago), 2023-08-24 08:12:28 -0500
    • Engine revision b20183e040
    • Dart version 3.1.0
    • DevTools version 2.25.0
    • If those were intentional, you can disregard the above warnings; however
      it is recommended to use "git" directly to perform update checks and
      upgrades.

[!] 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, 3.14.0-14.0.pre.212, on macOS 12.2.1 21D62
    darwin-x64, locale en-GB)
    • Flutter version 3.14.0-14.0.pre.212 on channel master at
      /Users/dhs/documents/fluttersdk/flutter
    ! Warning: `flutter` on your path resolves to
      /Users/dhs/Documents/Fluttersdk/flutter/bin/flutter, which is not inside
      your current Flutter SDK checkout at
      /Users/dhs/documents/fluttersdk/flutter. Consider adding
      /Users/dhs/documents/fluttersdk/flutter/bin to the front of your path.
    ! Warning: `dart` on your path resolves to
      /Users/dhs/Documents/Fluttersdk/flutter/bin/dart, which is not inside your
      current Flutter SDK checkout at /Users/dhs/documents/fluttersdk/flutter.
      Consider adding /Users/dhs/documents/fluttersdk/flutter/bin to the front
      of your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision ffe1ebd207 (67 minutes ago), 2023-09-11 03:46:15 -0400
    • Engine revision 1aa11b6448
    • Dart version 3.2.0 (build 3.2.0-134.0.dev)
    • DevTools version 2.27.0
    • If those were intentional, you can disregard the above warnings; however
      it is recommended to use "git" directly to perform update checks and
      upgrades.

[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/dhs/Library/Android/sdk
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for
      more details.

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

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

[✓] IntelliJ IDEA Ultimate Edition (version 2021.3.2)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • Flutter plugin version 65.1.4
    • Dart plugin version 213.7228

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

[✓] Connected device (3 available)
    • Darshan's iphone (mobile) • 21150b119064aecc249dfcfe05e259197461ce23 • ios
      • iOS 15.3.1 19D52
    • macOS (desktop)           • macos                                    •
      darwin-x64     • macOS 12.2.1 21D62 darwin-x64
    • Chrome (web)              • chrome                                   •
      web-javascript • Google Chrome 109.0.5414.119

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

! Doctor found issues in 1 category.
      
[!] 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.



@Piinks
Copy link
Contributor

Piinks commented Sep 11, 2023

@darshankawar are you not able to scroll with a mouse? Mouse wheel, drag, trackpad? I just checked on web/desktop and it scrolled fine (with a trackpad).

@Piinks
Copy link
Contributor

Piinks commented Sep 12, 2023

Since this is in the cookbook, transferring to flutter/website.
I suspect the issue is that the mouse wheel does not scroll the horizontal list when on desktop or web+desktop. This would be working as intended since a mouse scroll wheel is vertical input. The cookbook may just need to mention you can hold shift to scroll horizontally with a mouse wheel. Will need confirmation if that is the actual issue here.

@Piinks Piinks transferred this issue from flutter/flutter Sep 12, 2023
@danagbemava-nc danagbemava-nc added the st.triage.triage-team Triage team reviewing and categorizing the issue label Sep 12, 2023
@danagbemava-nc
Copy link
Member

Hi @Mairramer, were you trying to drag scroll or were you scrolling with a trackpad?

@danagbemava-nc danagbemava-nc added the act.wait-for-customer Needs response from customer label Sep 12, 2023
@Mairramer
Copy link

Hi @danagbemava-nc, I am trying to drag scroll.

@Piinks
Copy link
Contributor

Piinks commented Sep 12, 2023

Thanks for clarifying! this sounds like expected behavior then. A mouse should not be able to drag scroll on desktop, or web running on desktop.

We may want to update the cookbook to just mention how to scroll it with various devices/platforms.

@github-actions github-actions bot removed the act.wait-for-customer Needs response from customer label Sep 13, 2023
@thcbk
Copy link
Author

thcbk commented Sep 13, 2023

Since this is in the cookbook, transferring to flutter/website. I suspect the issue is that the mouse wheel does not scroll the horizontal list when on desktop or web+desktop. This would be working as intended since a mouse scroll wheel is vertical input. The cookbook may just need to mention you can hold shift to scroll horizontally with a mouse wheel. Will need confirmation if that is the actual issue here.

I was able to scroll horizontally if I press Shift when scrolling. Thank you!

@thcbk
Copy link
Author

thcbk commented Sep 13, 2023

Thank you all for supporting me!

@danagbemava-nc danagbemava-nc changed the title The horizontal list example doesn't work Add note on drag scrolling with mouse to 'Create a horizontal list' page Sep 13, 2023
@danagbemava-nc danagbemava-nc added d.enhancement Improves docs with specific ask p2-medium Necessary but not urgent concern. Resolve when possible. a.cookbook Relates to a cookbook recipe or guide e1-hours Effort: < 8 hrs t.ui.scrolling Relates to a scrolling UI widget from.flutter-sdk Reported via move from flutter/flutter target.web Target apps on the web platform t.desktop Relates to desktop compatibility of an app and removed st.triage.triage-team Triage team reviewing and categorizing the issue target.web Target apps on the web platform labels Sep 13, 2023
@atsansone atsansone added the fix.bug Needs fix of incorrect copy, code, or visual label Sep 15, 2023
atsansone added a commit that referenced this issue Dec 25, 2023
@darshankawar darshankawar added the cl.fixed Issue is closed as fixed label Jan 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a.cookbook Relates to a cookbook recipe or guide cl.fixed Issue is closed as fixed d.enhancement Improves docs with specific ask e1-hours Effort: < 8 hrs fix.bug Needs fix of incorrect copy, code, or visual from.flutter-sdk Reported via move from flutter/flutter p2-medium Necessary but not urgent concern. Resolve when possible. t.desktop Relates to desktop compatibility of an app t.ui.scrolling Relates to a scrolling UI widget
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants