Skip to content

Commit

Permalink
Preventing zoom in iOS Safari. (GoogleChromeLabs#395)
Browse files Browse the repository at this point in the history
  • Loading branch information
jakearchibald authored Dec 17, 2018
1 parent d68d932 commit 3a2c8da
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/components/App/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ export default class App extends Component<Props, State> {
};
}

// Since iOS 10, Apple tries to prevent disabling pinch-zoom. This is great in theory, but
// really breaks things on Squoosh, as you can easily end up zooming the UI when you mean to
// zoom the image. Once you've done this, it's really difficult to undo. Anyway, this seems to
// prevent it.
document.body.addEventListener('gesturestart', (event) => {
event.preventDefault();
});

window.addEventListener('popstate', this.onPopState);
}

Expand Down

0 comments on commit 3a2c8da

Please sign in to comment.