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

react-use-pointer-drag

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

react-use-pointer-drag - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

4

lib/index.d.ts

@@ -84,2 +84,6 @@ import React from 'react';

initialEvent?: PointerEvent;
/**
* PointerEvent object from current event.
*/
event?: PointerEvent;
}

@@ -86,0 +90,0 @@ export interface IPointerDragOptions<T> {

6

lib/index.js

@@ -36,2 +36,3 @@ import { useState, useEffect, useCallback, useRef } from 'react';

distance: Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2)),
event: e,
};

@@ -89,7 +90,2 @@ };

onPointerDown: (e) => {
const { stopPropagation = true, preventDefault = true } = optionsRef.current;
if (preventDefault)
e.preventDefault();
if (stopPropagation)
e.stopPropagation();
setDragState(state);

@@ -96,0 +92,0 @@ setIsStarted(true);

{
"version": "0.1.0",
"version": "0.1.1",
"license": "BSD-3-Clause-Clear",

@@ -4,0 +4,0 @@ "files": [

@@ -102,2 +102,7 @@ import React, { useState, useEffect, useCallback, useRef } from 'react';

initialEvent?: PointerEvent;
/**
* PointerEvent object from current event.
*/
event?: PointerEvent;
}

@@ -189,5 +194,3 @@

const getData = (
e: PointerEvent | React.PointerEvent,
): IPointerDragData<T> => {
const getData = (e: PointerEvent): IPointerDragData<T> => {
const { x: startX, y: startY, startedAt, initialEvent } = infoRef.current;

@@ -210,2 +213,3 @@

distance: Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2)),
event: e,
};

@@ -272,8 +276,2 @@ };

onPointerDown: (e: React.PointerEvent) => {
const { stopPropagation = true, preventDefault = true } =
optionsRef.current;
if (preventDefault) e.preventDefault();
if (stopPropagation) e.stopPropagation();
setDragState(state);

@@ -280,0 +278,0 @@ setIsStarted(true);

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