vanilla-long-press
TypeScript icon, indicating that this package has built-in type declarations

1.4.0 • Public • Published

Vanilla-long-press

Detected long press

Features

  • Сallback is triggered when the keys are held down for a long time

Installation

npm install vanilla-long-press

Usage

<div>
  <input id="my-input" />
</div>

<script>
  import LongPress from "long-press";

  const inputElement = document.getElementById("my-input");
  const cb = (event) => {
    console.log("Long press detected!");
  };
  new LongPress(inputElement, cb, 1000);

  setTimeout(() => inputElement._longPressDestroy(), 5000);
</script>

License

MIT License

Readme

Keywords

Package Sidebar

Install

npm i vanilla-long-press

Weekly Downloads

12

Version

1.4.0

License

MIT

Unpacked Size

6.9 kB

Total Files

9

Last publish

Collaborators

  • kutuzovska