Remove absorbPanEventsOnScrollables option#1455
Merged
JaffaKetchup merged 2 commits intofleaflet:masterfrom Apr 2, 2023
Merged
Conversation
3 tasks
Member
|
Thanks @rorystephenson, we'll try to have a look at this soon! |
Member
|
@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
Contributor
Author
Rebased both 👍 :) |
Member
|
@rorystephenson You happy for this to be merged now? Not sure if it will cause more conflicts. |
Contributor
Author
Yep I think it's good to go. |
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
absorbPanEventsOnScrollablesis 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 sameGestureArenaTeamand 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_dragmarkerand likely other plugins detect pan gestures instead of horizontal/vertical drag gestures. This means that whenabsorbPanEventsOnScrollablesis 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
absabsorbPanEventsOnScrollablesremoved 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