-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
ios: dragging=false but scrolling on map not possible #5425
Comments
I tried the fiddle on my Android device, where it works as expected, and enabling dragging also works as expected, so it looks like an iOS specific bug. Looking at http://caniuse.com/#feat=css-touch-action, it seems that iOS only has partial support for In the linked fiddle, the map has Line 54 in 364bc77
|
sadly it didn't help: i updated the fiddle to set https://jsfiddle.net/geg8yLe3/6/ could one of the event handlers do preventDefault? |
@oberhamsi huh, that's weird. Regarding @oberhamsi it would be interesting if you could possibly dig into this and try to debug what's happening, unfortunately I don't have easy access to any iOS device. |
Has there been any resolution to this? Still having this issue. |
@GeorgeColdham sadly, no. As mentioned in my last comment, I'm stuck since I don't have easy access to any iOS device to test with, since this does work as expected on Android. We need to examine which CSS rules or event handlers that trigger on iOS that prevents the map from scrolling, so any help with this would be greatly appreciated! |
I have the same problem. I'm using the webview in IOS. But the problem occurs without web preview as well. I tested on chrome and safari. My device is iphone 4s |
Hi, |
The Google Maps JS SDK has the same function properly working on iOS/Android. As far as I can see it works without touch-action. Any idea how they do it? |
@perliedman I think the root issue is the If I remove it (or add tap=false to options), it works on iOS. The problem would also appear in Chrome on Android before version 55 (Chrome since version 55 has support for pointer events and then uses different code paths in Leaflet). You can check it if you go to chrome://flags on your Android device and set pointer events to |
@herrernst huh, nice analysis! Thanks! It is definitely the tap handler that causes this. Looking at the test code we used in #4051, we actually had So, for now, the workaround is to not only set I've submitted #5670 in an attempt to address this, so that we do not |
@perliedman Thanks for your responsive and patch! |
This can be reproduced on android (7.0) with at least the latest beta version of Firefox 2 |
I can confirm that the following code seems to be a valid workaround for ensuring that a single finger scrolls the page and not the map, while still allowing for two-finger zoom+pan of the map, as well as tapping on markers. This improves usability on mobile when a map is a part of a larger page that requires scrolling.
Confirmed in iOS 10 Safari and Chrome. Not yet fully tested on Android. |
I also confirm it works in iOS 11.3.1, on both safari and chrome 66 |
@SimonEast Seems to work good in mobile FireFox on Android, Chrome doesn't like it as much. Zooms the whole website. iOS(11.4) Safari and FF work great. I've tried 4 or 5 different css/js tricks, in the end this one works out of the box. Thank you. |
Does anyone find the solution yet ? |
@HlaingTinHtun |
Then it can be fixed with #7026. Test page is here: https://jsfiddle.net/johnd0e/8kytb1dc/2/show |
I can confirm that it is not. |
Solve a usability issue when a user's scrolls on pages with a map and additional content below. When the user is scrolling, and the mouse goes over the map, the window stops scrolling, and the map starts moving; this behaviour annoys the users as they expect to keep scrolling the page to the bottom. A similar problem occurs when browsing the page on touchable devices like phones or tablets. We are disabling the mouse wheel map listener to keep scrolling to the page bottom on desktop devices. We are disabling the dragging and the tap features for mobile devices, although as the user can not move the map, we need arrow controls to allow users to change the map pan. Credits for the mobile solution are for SimonEast [1]. [1] Leaflet/Leaflet#5425 (comment)
Solve a usability issue when a user's scrolls on pages with a map and additional content below. When the user is scrolling, and the mouse goes over the map, the window stops scrolling, and the map starts moving; this behaviour annoys the users as they expect to keep scrolling the page to the bottom. A similar problem occurs when browsing the page on touchable devices like phones or tablets. We are disabling the mouse wheel map listener to keep scrolling to the page bottom on desktop devices. We are disabling the dragging and the tap features for mobile devices, although as the user can not move the map, we need arrow controls to allow users to change the map pan. Credits for the mobile solution are for SimonEast [1]. [1] Leaflet/Leaflet#5425 (comment)
Solve a usability issue when a user's scrolls on pages with a map and additional content below. When the user is scrolling, and the mouse goes over the map, the window stops scrolling, and the map starts moving; this behaviour annoys the users as they expect to keep scrolling the page to the bottom. A similar problem occurs when browsing the page on touchable devices like phones or tablets. We are disabling the mouse wheel map listener to keep scrolling to the page bottom on desktop devices. We are disabling the dragging and the tap features for mobile devices, although as the user can not move the map, we need arrow controls to allow users to change the map pan. Credits for the mobile solution are for SimonEast [1]. [1] Leaflet/Leaflet/issues/5425#issuecomment-342055520
How to reproduce
What behaviour I'm expecting and which behaviour I'm seeing
When
dragging
is disabled, i expect the page to scroll when i drag over the map on ios. instead, nothing happens. on android i can scroll by dragging if dragging=false.Minimal example reproducing the issue
On ios, it's not possible to scroll the page when dragging on the map:
https://jsfiddle.net/geg8yLe3/
This is similar to #5343
The text was updated successfully, but these errors were encountered: