Skip to content

A React component that disables double tap to zoom on iOS

Notifications You must be signed in to change notification settings

rymdkraftverk/disable-double-tap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Disable double tap

Prevent default double tap behavior in iOS Safari

What is this?

The default behavior in Safari on iOS is to zoom in whenever the user double taps. This behavior is not always desireable. For example, if you are making a game where the user can tap twice in quick succession. It is not obvious how to disable it though, since Apple doesn't want developers to disable this behavior.

This library is a React component that prevents this default behavior.

How to use

yarn add disable-double-tap

or

npm install disable-double-tap

import React from "react";
import DisableDoubleTap from "disable-double-tap";

const Component = () => {
  return (
    <DisableDoubleTap>
      <div>{`Double tapping on me won't zoom in!`}</div>
    </DisableDoubleTap>
  );
};

About

A React component that disables double tap to zoom on iOS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published