-
-
Notifications
You must be signed in to change notification settings - Fork 860
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
Remove absorbPanEventsOnScrollables option #1455
Remove absorbPanEventsOnScrollables option #1455
Conversation
Thanks @rorystephenson, we'll try to have a look at this soon! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
@rorystephenson When you get a moment from working on #1475, can you resolve the conflicts here for merge? (Also note that #1475 needs the same conflicts resolved). |
The only reason this has been kept around is because some plugins which used drag gestures relied on it. It turns out if those plugins detect vertical/horizontal drag instead of pan this flag is not necessary.
7993046
to
06b76dc
Compare
Rebased both 👍 :) |
@rorystephenson You happy for this to be merged now? Not sure if it will cause more conflicts. |
Yep I think it's good to go. |
The only reason to disable absorbing of pan events is because some plugins which use drag gestures rely on it. It turns out if those plugins detect vertical/horizontal drag instead of pan this flag is not necessary.
Note that affected plugins need to be updated and this should be released in a major version bump as it is a breaking change.
See #1454 discussion leading to this PR.
Before releasing
Understanding more
absorbPanEventsOnScrollables
is true a horizontal & vertical drag gesture detector are added to FlutterMap and if they are triggered FlutterMap's scale gesture logic is triggered since the vertical/horizontal drag gesture and scale gesture are in the sameGestureArenaTeam
and the scale gesture is the captain of that team. Horizontal/vertical drag gestures are recognised faster than scale/pan gestures and therefore when there are competing gestures they will prevail.flutter_map_dragmarker
and likely other plugins detect pan gestures instead of horizontal/vertical drag gestures. This means that whenabsorbPanEventsOnScrollables
is enabled those plugins don't work because FlutterMap's horizontal/vertical drag gestures have precedence. This is a simple fix, affected code should listen toonVerticalDrag(Start/Update/End)
andonHorizontalDrag(Start/Update/End)
instead ofonPan(Start/Update/End)
.Demo
With
absabsorbPanEventsOnScrollables
removed such that horizontal/vertical gestures are always detected in FlutterMap (see this PR's code changes) and a modifiedflutter_map_dragmarker
(detecting horizontal/vertical drag instead of pan) is used it is possible to have a pan-able FlutterMap inside of a ListView containing drag markers which can be dragged:demo.mp4