Skip to content

Commit aa1efbf

Browse files
committed
fix:DragSortableView和AutoDragSortableView组件拖拽排序会出现空白问题
1 parent 2415078 commit aa1efbf

File tree

4 files changed

+11
-18
lines changed

4 files changed

+11
-18
lines changed

lib/AutoDragSortableView.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -368,13 +368,7 @@ export default class AutoDragSortableView extends Component{
368368
} else if (index >= moveToIndex && index < this.touchCurItem.index) {
369369
nextItem = this.state.dataSource[index+1]
370370

371-
} else if (index != this.touchCurItem.index &&
372-
(item.position.x._value != item.originLeft ||
373-
item.position.y._value != item.originTop)) {
374-
nextItem = this.state.dataSource[index]
375-
376-
} else if ((this.touchCurItem.index-moveToIndex > 0 && moveToIndex == index+1) ||
377-
(this.touchCurItem.index-moveToIndex < 0 && moveToIndex == index-1)) {
371+
} else {
378372
nextItem = this.state.dataSource[index]
379373
}
380374

lib/DragSortableView.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -227,13 +227,7 @@ export default class DragSortableView extends Component{
227227
} else if (index >= moveToIndex && index < this.touchCurItem.index) {
228228
nextItem = this.state.dataSource[index+1]
229229

230-
} else if (index != this.touchCurItem.index &&
231-
(item.position.x._value != item.originLeft ||
232-
item.position.y._value != item.originTop)) {
233-
nextItem = this.state.dataSource[index]
234-
235-
} else if ((this.touchCurItem.index-moveToIndex > 0 && moveToIndex == index+1) ||
236-
(this.touchCurItem.index-moveToIndex < 0 && moveToIndex == index-1)) {
230+
} else {
237231
nextItem = this.state.dataSource[index]
238232
}
239233

lib/harmony/.gitkeep

Whitespace-only changes.

lib/package.json

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"name": "react-native-drag-sort",
2+
"name": "@react-native-oh-tpl/react-native-drag-sort",
33
"version": "2.4.4",
44
"description": "Drag and drop sort control for react-native",
5-
"main": "index.js",
5+
"main": "index",
66
"scripts": {
77
"test": "echo \"Error: no test specified\" && exit 1"
88
},
@@ -23,10 +23,15 @@
2323
],
2424
"author": "mochixuan",
2525
"license": "ISC",
26-
"dependencies": {},
26+
"dependencies": {
27+
"react-native-drag-sort": "^2.4.4"
28+
},
2729
"devDependencies": {},
2830
"bugs": {
2931
"url": "https://github.com/mochixuan/react-native-drag-sort/issues"
3032
},
31-
"homepage": "https://github.com/mochixuan/react-native-drag-sort#readme"
33+
"homepage": "https://github.com/mochixuan/react-native-drag-sort#readme",
34+
"harmony": {
35+
"alias": "react-native-drag-sort"
36+
}
3237
}

0 commit comments

Comments
 (0)