flutter_map icon indicating copy to clipboard operation
flutter_map copied to clipboard

[BUG] MacOS: Cannot scroll with trackpad inside scrollable if `InteractiveFlag.drag` enabled

Open AndreiMisiukevich opened this issue 2 years ago • 15 comments

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?

Oct-31-2022 03-22-34

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 doctor finds 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

AndreiMisiukevich avatar Oct 31 '22 02:10 AndreiMisiukevich

Hi @AndreiMisiukevich! Unfortunately, I think MacOS gesture handling has been undergoing some changes in Flutter recently. Maybe similar/related to #1354?

JaffaKetchup avatar Nov 01 '22 21:11 JaffaKetchup

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

AndreiMisiukevich avatar Nov 01 '22 21:11 AndreiMisiukevich

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?

JaffaKetchup avatar Nov 01 '22 21:11 JaffaKetchup

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

AndreiMisiukevich avatar Nov 01 '22 22:11 AndreiMisiukevich

Hmm, that is quite strange. I'm not sure what we can do, but I'll leave this open for now :)

JaffaKetchup avatar Nov 01 '22 22:11 JaffaKetchup

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.

github-actions[bot] avatar Dec 02 '22 02:12 github-actions[bot]

I believe this is still the issue :)

AndreiMisiukevich avatar Dec 02 '22 11:12 AndreiMisiukevich

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.

github-actions[bot] avatar Jan 20 '23 02:01 github-actions[bot]

I believe this is still the issue :)

AndreiMisiukevich avatar Jan 20 '23 02:01 AndreiMisiukevich

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 avatar May 20 '23 17:05 JaffaKetchup

@JaffaKetchup hey I think I can still reproduce it

AndreiMisiukevich avatar May 21 '23 02:05 AndreiMisiukevich

Looks like absorbPanEventsOnScrollables: false, does the trick

AndreiMisiukevich avatar Oct 31 '23 04:10 AndreiMisiukevich

That's interesting, thanks for sharing. Unfortunately that option isn't available in the latest FM versions, so I'm going to reopen this.

JaffaKetchup avatar Oct 31 '23 07:10 JaffaKetchup