Skip to content
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

Fix map pan when touchZoom is disabled #5952

Merged
merged 3 commits into from Dec 15, 2017
Merged

Fix map pan when touchZoom is disabled #5952

merged 3 commits into from Dec 15, 2017

Conversation

cherniavskii
Copy link
Sponsor Collaborator

@cherniavskii cherniavskii commented Dec 5, 2017

Fixes #5779, closes #5951.

In #4552 @perliedman introduced change, which allows page native scroll when the touch zoom and map drag handlers are disabled.
How it works on current master:

dragging touchZoom Result
enabled enabled dragging and touchZoom work
disabled disabled ✅ neither dragging nor touchZoom work, page is not prevented from scrolling
disabled enabled dragging doesn't work, touchZoom works, page is not prevented from scrolling
enabled disabled ⚠️ touchZoom doesn't work, but dragging doesn't work either, page is not prevented from scrolling. Expected: touchZoom doesn't work, dragging works and page is not prevented from scrolling - #5779

So touch-action: none should be added if dragging is enabled and should not be added if dragging is disabled, whether touchZoom is enabled or not.

@cherniavskii
Copy link
Sponsor Collaborator Author

cherniavskii commented Dec 5, 2017

Looks like modified CSS rule can be combined with that above, but I'm not sure which -ms-touch-action value should stay.
Also, I haven't tested it on Edge/IE, I'll appreciate any help with that.

Added touch-action: pinch-zoom, since it's already supported in Chrome 56+ and a fallback touch-action: none for FF.

@perliedman perliedman merged commit 2ce37c5 into master Dec 15, 2017
@perliedman
Copy link
Member

👍 Nice, sorry for taking forever to review/merge. Just can't find that much time for Leaflet these days 😢

@cherniavskii cherniavskii deleted the fix-map-pan branch December 15, 2017 16:25
@cherniavskii
Copy link
Sponsor Collaborator Author

@perliedman no worries :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TouchZoom Disable causes dragging to not work correctly
2 participants