Avoid mousewheel/finger trap in the map #4768
Closed
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.
References
This fixes usability issues when scrolling pages with a map and more content below. card-74165431
Objectives
Make it easier for users to scroll the page to the bottom by:
Visual Changes
Before
![map-pan-control-before](https://user-images.githubusercontent.com/15726/148995066-c62ccbcc-f8a9-4f4a-bc65-aa2b2d4a6c3d.jpg)
After
![map-pan-control-after-mobile](https://user-images.githubusercontent.com/15726/148995036-b4724bf2-4aab-46db-9d82-57fca332c5c6.png)
![map-pan-control-after](https://user-images.githubusercontent.com/15726/148995060-9303096f-d940-45e5-9b66-1d04a23a7578.jpg)
Notes
Alternative solutions
The first solution I tried was to install a Leaflet plugin that adds a similar behaviour to Google Maps Gesture Handling plugin. During mobile testing, I found it works nicely in Chrome, Edge, Opera and Safari, while the user experience when using two fingers to move or zoom the map is annoying in Firefox. Unfortunately, it seems to conflict in some way with the page scroll, so I finally chose to use controls to allow users to move the map. Here is a work in progress branch with the Leatflet.GestureHandling plugin installed in CONSUL.