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

react-sortable-hoc

Package Overview
Dependencies
Maintainers
1
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-sortable-hoc - npm Package Compare versions

Comparing version 0.8.0 to 0.8.1

4

CHANGELOG.md
Changelog
------------
### 0.8.1
- Fix scrolling issues on mobile with anchor tag elements [#380](https://github.com/clauderic/react-sortable-hoc/pull/380)
- Update TypeScript type definition for ContainerGetter to accept Promises that return HTMLElements
### 0.8.0

@@ -4,0 +8,0 @@ - Allow `getContainer` to return a promise. This is useful when the container node is rendered by a parent component, since `componentDidMount` fires backwards (from child to parent) [#155](https://github.com/clauderic/react-sortable-hoc/pull/155/)

2

dist/commonjs/SortableContainer/index.js

@@ -94,3 +94,3 @@ 'use strict';

*/
if (event.target.tagName.toLowerCase() === 'a') {
if (!(0, _utils.isTouchEvent)(event) && event.target.tagName.toLowerCase() === 'a') {
event.preventDefault();

@@ -97,0 +97,0 @@ }

@@ -14,2 +14,3 @@ 'use strict';

exports.getPosition = getPosition;
exports.isTouchEvent = isTouchEvent;
exports.getEdgeOffset = getEdgeOffset;

@@ -130,2 +131,6 @@ exports.getLockPixelOffset = getLockPixelOffset;

function isTouchEvent(event) {
return event instanceof TouchEvent || event.touches && event.touches.length || event.changedTouches && event.changedTouches.length;
}
function getEdgeOffset(node, parent) {

@@ -132,0 +137,0 @@ var offset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : { top: 0, left: 0 };

@@ -16,3 +16,3 @@ import _extends from 'babel-runtime/helpers/extends';

import Manager from '../Manager';
import { closest, events, vendorPrefix, limit, getEdgeOffset, getElementMargin, getLockPixelOffset, getPosition, provideDisplayName, omit } from '../utils';
import { closest, events, vendorPrefix, limit, getEdgeOffset, getElementMargin, getLockPixelOffset, getPosition, isTouchEvent, provideDisplayName, omit } from '../utils';

@@ -68,3 +68,3 @@ // Export Higher Order Sortable Container Component

*/
if (event.target.tagName.toLowerCase() === 'a') {
if (!isTouchEvent(event) && event.target.tagName.toLowerCase() === 'a') {
event.preventDefault();

@@ -71,0 +71,0 @@ }

@@ -110,2 +110,6 @@ import _Object$keys from 'babel-runtime/core-js/object/keys';

export function isTouchEvent(event) {
return event instanceof TouchEvent || event.touches && event.touches.length || event.changedTouches && event.changedTouches.length;
}
export function getEdgeOffset(node, parent) {

@@ -112,0 +116,0 @@ var offset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : { top: 0, left: 0 };

{
"name": "react-sortable-hoc",
"version": "0.8.0",
"version": "0.8.1",
"description": "Set of higher-order components to turn any list into a sortable, touch-friendly, animated list",

@@ -5,0 +5,0 @@ "author": {

@@ -42,3 +42,3 @@ import * as React from 'react';

export type ContainerGetter = (element: React.ReactElement<any>) => HTMLElement;
export type ContainerGetter = (element: React.ReactElement<any>) => HTMLElement | Promise<HTMLElement>;

@@ -45,0 +45,0 @@ export interface Dimensions {

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

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