flutter_map
flutter_map copied to clipboard
[BUG] MacOS: Cannot scroll with trackpad inside scrollable if `InteractiveFlag.drag` enabled
What is the bug?
If I put FlutterMap inside ScrollView (e.g. SingleChildScrollView with a Column of several elements) I cannot scroll the scroll view with the trackpad if the mouse pointer is hovering over the map.
I added enableScrollWheel: false, but it didn't help (Honestly, I see any difference with or without this property)
I found, that this happens only if interactiveFlags contains InteractiveFlag.drag element, otherwise scroll with the trackpad works fine.
What is the expected behaviour?
It should be possible to scroll the scrollview when hovering FlutterMap on macOS if enableScrollWheel: false, passed
How can we reproduce this issue?
return SingleChildScrollView(
child: Column(children: [
SizedBox(
height: 224,
child: FlutterMap(
options: MapOptions(
interactiveFlags: InteractiveFlag.drag | InteractiveFlag.doubleTapZoom,
),
children: [
TileLayer(
// Free OSM
urlTemplate: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
subdomains: const ['a', 'b', 'c'],
),
],
),
),
const SizedBox(height: 2000),
]),
);
Do you have a potential solution?
No :( For some reason, it works fine on the Web
Can you provide any other information?

Platforms Affected
MacOS
Severity
Obtrusive: Prevents normal functioning but causes no errors in the console
Frequency
Consistently: Always occurs at the same time and location
Requirements
- [X] I agree to follow this project's Code of Conduct
- [X] My Flutter/Dart installation is unaltered, and
flutter doctorfinds no relevant issues - [X] I am using the latest stable version of this package
- [X] I have checked the FAQs section on the documentation website
- [X] I have checked for similar issues which may be duplicates
Hi @AndreiMisiukevich! Unfortunately, I think MacOS gesture handling has been undergoing some changes in Flutter recently. Maybe similar/related to #1354?
Hi @AndreiMisiukevich! Unfortunately, I think MacOS gesture handling has been undergoing some changes in Flutter recently. Maybe similar/related to #1354?
Thanks for your response.
Maybe by chance, you know how to work around it? I need somehow make FlutterMap ignore wheel scroll gestures.
Also, if I don't pass InteractiveFlag.drag it works fine as well
Unfortunately not. Slightly strange that disabling enableScrollWheel doesn't work, and not quite sure what you mean by...
if I don't pass InteractiveFlag.drag it works fine as well
What does 'works fine' mean?
EDIT: This line:
interactiveFlags: InteractiveFlag.drag | InteractiveFlag.doubleTapZoom,
may not work as you expect? But to be honest I can't be sure. What happens if you use '&' instead?
may not work as you expect? But to be honest I can't be sure. What happens if you use '&' instead? In this case, I cannot drag the map.
What does 'works fine' mean? I mean, that I can scroll by trackpad in this case, but dragging does not work.
So, if dragging is disabled, then I can scroll by trackpad, but if it's enabled, then I can't
Hmm, that is quite strange. I'm not sure what we can do, but I'll leave this open for now :)
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
I believe this is still the issue :)
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
I believe this is still the issue :)
Hey @AndreiMisiukevich, when you get a moment, can you re-evaluate whether this issue is still applicable in the 'master' branch with the latest Flutter 3.10 version? Thanks!
@JaffaKetchup hey I think I can still reproduce it
Looks like absorbPanEventsOnScrollables: false, does the trick
That's interesting, thanks for sharing. Unfortunately that option isn't available in the latest FM versions, so I'm going to reopen this.