react-native-drag-sort
Advanced tools
Comparing version 2.2.4 to 2.3.4
@@ -206,3 +206,4 @@ import React, {Component} from 'react' | ||
if (this.sortRefs.has(touchIndex)) { | ||
const key = this._getKey(touchIndex); | ||
if (this.sortRefs.has(key)) { | ||
@@ -229,3 +230,3 @@ // Initialization data | ||
this.touchCurItem = { | ||
ref: this.sortRefs.get(touchIndex), | ||
ref: this.sortRefs.get(key), | ||
index: touchIndex, | ||
@@ -612,2 +613,7 @@ originLeft: this.state.dataSource[touchIndex].originLeft, | ||
_getKey = (index) => { | ||
const item = this.state.dataSource[index]; | ||
return this.props.keyExtractor ? this.props.keyExtractor(item.data, index) : item.originIndex; | ||
} | ||
_renderItemView = () => { | ||
@@ -621,3 +627,3 @@ return this.state.dataSource.map((item,index)=>{ | ||
key={key} | ||
ref={(ref) => this.sortRefs.set(index,ref)} | ||
ref={(ref) => this.sortRefs.set(key,ref)} | ||
{...this._panResponder.panHandlers} | ||
@@ -624,0 +630,0 @@ style={[styles.item,{ |
@@ -118,3 +118,4 @@ import React, {Component} from 'react' | ||
if (this.sortRefs.has(touchIndex)) { | ||
const key = this._getKey(touchIndex); | ||
if (this.sortRefs.has(key)) { | ||
if (this.props.onDragStart) { | ||
@@ -132,3 +133,3 @@ this.props.onDragStart(touchIndex) | ||
this.touchCurItem = { | ||
ref: this.sortRefs.get(touchIndex), | ||
ref: this.sortRefs.get(key), | ||
index: touchIndex, | ||
@@ -421,2 +422,7 @@ originLeft: this.state.dataSource[touchIndex].originLeft, | ||
_getKey = (index) => { | ||
const item = this.state.dataSource[index]; | ||
return this.props.keyExtractor ? this.props.keyExtractor(item.data, index) : item.originIndex; | ||
} | ||
_renderItemView = () => { | ||
@@ -426,7 +432,7 @@ return this.state.dataSource.map((item,index)=>{ | ||
transformObj[this.props.scaleStatus] = item.scaleValue | ||
const key = this.props.keyExtractor ? this.props.keyExtractor(item.data,index) : item.originIndex | ||
const key = this._getKey(index); | ||
return ( | ||
<Animated.View | ||
key={key} | ||
ref={(ref) => this.sortRefs.set(index,ref)} | ||
ref={(ref) => this.sortRefs.set(key,ref)} | ||
{...this._panResponder.panHandlers} | ||
@@ -433,0 +439,0 @@ style={[styles.item,{ |
{ | ||
"name": "react-native-drag-sort", | ||
"version": "2.2.4", | ||
"version": "2.3.4", | ||
"description": "Drag and drop sort control for react-native", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
80913
1136