Repository navigation
Horizontal ListView in nested ListViews doesn't work #150236
Copy link
Copy link
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: desktopRunning on desktopRunning on desktopf: scrollingViewports, list views, slivers, etc.Viewports, list views, slivers, etc.found in release: 3.23Found to occur in 3.23Found to occur in 3.23frameworkflutter/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 onr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework team
Description
Steps to reproduce
- Run the sample code
- Scroll the horizontal list view
Expected results
Should be able to scroll horizontally.
Actual results
Doesn't scroll and the scroll bar for the vertical list view is highlighted. This issue happens on both iOS and web but only happens when I'm using trackpad.
Code sample
Code sample
import 'package:flutter/material.dart';
/// Flutter code sample for [Carousel].
void main() => runApp(const ExampleApp());
class ExampleApp extends StatelessWidget {
const ExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
appBar: AppBar(
title: const Text('Carousel Sample'),
),
body: const Example(),
),
);
}
}
class Example extends StatefulWidget {
const Example({super.key});
@override
State<Example> createState() => _ExampleState();
}
class _ExampleState extends State<Example> {
@override
Widget build(BuildContext context) {
return ListView(
children: <Widget>[
Container(
width: 200,
height: 200,
color: Colors.amber[50],
),
Center(
child: ConstrainedBox(
constraints: const BoxConstraints(maxHeight: 200),
child: ListView(
scrollDirection: Axis.horizontal,
children: List.generate(20, (int index) {
return ConstrainedBox(constraints: BoxConstraints.tightFor(width: 200), child: Card.outlined(child: SizedBox(width: 200, height: 200, child: Center(child: Text('Item $index')),),),);
}),
)
),
),
Container(
width: 200,
height: 200,
color: Colors.amber[100],
),
Container(
width: 200,
height: 200,
color: Colors.amber[200],
),
],
);
}
}
Screenshots or Video
Screenshots / Video demonstration
Screen.Recording.2024-06-13.at.4.00.09.PM.mov
Might be related to #146654
CC: @HansMuller
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: desktopRunning on desktopRunning on desktopf: scrollingViewports, list views, slivers, etc.Viewports, list views, slivers, etc.found in release: 3.23Found to occur in 3.23Found to occur in 3.23frameworkflutter/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 onr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework team
Activity
ANKESH559 commentedon Jun 14, 2024
listview.mp4
darshankawar commentedon Jun 14, 2024
@QuncCccccc Hello,
I ran the provided code sample using latest stable version in web and was able to scroll horizontally using trackpad as shown below:
150236.mov
Can you provide the flutter version in which you see the reported behavior ? The video you provided isn't accessible.
HansMuller commentedon Jun 14, 2024
@darshankawar this issue should be checked against the latest master branch which includes #146654
HansMuller commentedon Jun 14, 2024
I checked the example on macOS and web with the not-yet-landed fixes in #150275 and found horizontal scrolling on macOS to be a little unpredictable that seems to be due to confusion about the primary scroll controller. If I specified a horizontal scrollbar (and controller) everything seemed to work as expected.
Code sample with horizontal scrollbar
darshankawar commentedon Jun 17, 2024
I also observed this specially on desktop only and not on web with latest master version.
master flutter doctor -v
Improve the behavior of scrollbar drag-scrolls triggered by the track…
Improve the behavior of scrollbar drag-scrolls triggered by the track…
github-actions commentedon Jul 11, 2024
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.