Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

touch-dnd-custom-events

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

touch-dnd-custom-events

Intercepts touch events (`touchstart`, `touchmove`, `touchend`) on draggable html elements and generates custom drag and drop events instead

  • 1.5.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Touch Drag and Drop Custom Events

Circle CI

Installation

npm install --save touch-dnd-custom-events

Usage

import setupTouchDNDCustomEvents from 'touch-dnd-custom-events'

setupTouchDNDCustomEvents()

Once the initial setup function is called (setupTouchDNDCustomEvents()), touch events (touchstart on draggable html elements, touchmove during a drag, touchend during a drag) are intercepted and dispatch custom drag and drop events with the same datatransfer interface as html 5 drag and drop events (see https://html.spec.whatwg.org/multipage/interaction.html#datatransfer for details).

The custom event names are as follows.

  • touchdragstart (equivalent of html5 dragstart)
  • touchdrag (equivalent of html5 drag)
  • touchdragenter (equivalent of html5 dragenter)
  • touchdragleave (equivalent of html5 dragleave)
  • touchdragover (equivalent of html5 dragover)
  • touchdrop (equivalent of html5 drop)
  • touchdragend (equivalent of html5 dragend)

Because these custom events have the same interface as html5 drag and drop events, they can be treated the same way as a normal html 5 drag and drop event.

License

MIT

FAQs

Package last updated on 08 Feb 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc