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 double tap zoom on iOS 13 #9757

Merged
merged 1 commit into from
Jun 8, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions src/ui/handler_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,14 @@ class HandlerManager {
const el = this._el;

this._listeners = [
// Bind touchstart and touchmove with passive: false because, even though
// they only fire a map events and therefore could theoretically be
// passive, binding with passive: true causes iOS not to respect
// e.preventDefault() in _other_ handlers, even if they are non-passive
// (see https://bugs.webkit.org/show_bug.cgi?id=184251)
[el, 'touchstart', {passive: false}],
// This needs to be `passive: true` so that a double tap fires two
// pairs of touchstart/end events in iOS Safari 13. If this is set to
// `passive: false` then the second pair of events is only fired if
// preventDefault() is called on the first touchstart. Calling preventDefault()
// undesirably prevents click events.
[el, 'touchstart', {passive: true}],
// This needs to be `passive: false` so that scrolls and pinches can be
// prevented in browsers that don't support `touch-actions: none`, for example iOS Safari 12.
[el, 'touchmove', {passive: false}],
[el, 'touchend', undefined],
[el, 'touchcancel', undefined],
Expand Down