rymdkraftverk / disable-double-tap

A React component that disables double tap to zoom on iOS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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


Languages

Language:JavaScript 100.0%