react-movable
Advanced tools
Comparing version 2.5.1 to 2.5.2
@@ -127,2 +127,3 @@ "use strict"; | ||
var opts = { passive: false }; | ||
listItemTouched.style.touchAction = 'none'; | ||
document.addEventListener('touchend', _this.schdOnEnd, opts); | ||
@@ -135,2 +136,6 @@ document.addEventListener('touchmove', _this.schdOnTouchMove, opts); | ||
document.addEventListener('mouseup', _this.schdOnEnd); | ||
var listItemDragged = _this.getChildren()[_this.state.itemDragged]; | ||
if (listItemDragged && listItemDragged.style) { | ||
listItemDragged.style.touchAction = ''; | ||
} | ||
} | ||
@@ -445,3 +450,2 @@ _this.onStart(listItemTouched, isTouch ? e.touches[0].clientX : e.clientX, isTouch ? e.touches[0].clientY : e.clientY, index); | ||
userSelect: 'none', | ||
touchAction: 'none', | ||
WebkitUserSelect: 'none', | ||
@@ -504,3 +508,3 @@ MozUserSelect: 'none', | ||
overflow: 'hidden', | ||
clip: 'react(0px, 0px, 0px, 0px)', | ||
clip: 'rect(0px, 0px, 0px, 0px)', | ||
clipPath: 'inset(100%)' | ||
@@ -507,0 +511,0 @@ } }, this.state.liveText))); |
@@ -18,28 +18,32 @@ /// <reference types="react" /> | ||
} | ||
export interface RenderItemParams<Value> { | ||
value: Value; | ||
props: IItemProps; | ||
index?: number; | ||
isDragged: boolean; | ||
isSelected: boolean; | ||
isOutOfBounds: boolean; | ||
} | ||
export interface RenderListParams { | ||
children: React.ReactNode; | ||
isDragged: boolean; | ||
props: { | ||
ref: React.RefObject<any>; | ||
}; | ||
} | ||
export interface BeforeDragParams { | ||
elements: Element[]; | ||
index: number; | ||
} | ||
export interface OnChangeMeta { | ||
oldIndex: number; | ||
newIndex: number; | ||
targetRect: ClientRect; | ||
} | ||
export interface IProps<Value> { | ||
beforeDrag?: (params: { | ||
elements: Element[]; | ||
index: number; | ||
}) => void; | ||
renderItem: (params: { | ||
value: Value; | ||
props: IItemProps; | ||
index?: number; | ||
isDragged: boolean; | ||
isSelected: boolean; | ||
isOutOfBounds: boolean; | ||
}) => React.ReactNode; | ||
renderList: (props: { | ||
children: React.ReactNode; | ||
isDragged: boolean; | ||
props: { | ||
ref: React.RefObject<any>; | ||
}; | ||
}) => React.ReactNode; | ||
beforeDrag?: (params: BeforeDragParams) => void; | ||
renderItem: (params: RenderItemParams<Value>) => React.ReactNode; | ||
renderList: (props: RenderListParams) => React.ReactNode; | ||
values: Value[]; | ||
onChange: (meta: { | ||
oldIndex: number; | ||
newIndex: number; | ||
targetRect: ClientRect; | ||
}) => void; | ||
onChange: (meta: OnChangeMeta) => void; | ||
transitionDuration: number; | ||
@@ -46,0 +50,0 @@ removableByMove: boolean; |
{ | ||
"name": "react-movable", | ||
"version": "2.5.1", | ||
"version": "2.5.2", | ||
"description": "Drag and drop lists.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
53464
806