Skip to content

Commit 6f8d24b

Browse files
committed
chore: optimize the animation effect
1 parent 66e7fd4 commit 6f8d24b

File tree

4 files changed

+14
-8
lines changed

4 files changed

+14
-8
lines changed

dist/virtual-drag-list.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* vue-virtual-drag-list v2.9.4
2+
* vue-virtual-drag-list v2.9.5
33
* open source under the MIT license
44
* https://github.com/mfuu/vue-virtual-drag-list#readme
55
*/
@@ -1048,8 +1048,12 @@
10481048
}, {});
10491049
this.sortable = new Dnd(this.el, Object.assign(Object.assign({}, props), {
10501050
emptyInsertThreshold: 0,
1051-
swapOnDrop: false,
1052-
removeCloneOnDrop: false,
1051+
swapOnDrop: function swapOnDrop(event) {
1052+
return event.from === event.to;
1053+
},
1054+
removeCloneOnDrop: function removeCloneOnDrop(event) {
1055+
return event.from === event.to;
1056+
},
10531057
onDrag: function onDrag(event) {
10541058
return _this.onDrag(event);
10551059
},
@@ -1119,7 +1123,9 @@
11191123
if (event.from === this.el && this.reRendered) {
11201124
(_b = Dnd.dragged) === null || _b === void 0 ? void 0 : _b.remove();
11211125
}
1122-
(_c = Dnd.clone) === null || _c === void 0 ? void 0 : _c.remove();
1126+
if (event.from !== event.to) {
1127+
(_c = Dnd.clone) === null || _c === void 0 ? void 0 : _c.remove();
1128+
}
11231129
this.reRendered = false;
11241130
}
11251131
}, {

dist/virtual-drag-list.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-virtual-draglist",
3-
"version": "2.9.4",
3+
"version": "2.9.5",
44
"description": "A virtual scrolling list component that can be sorted by dragging",
55
"main": "dist/virtual-drag-list.min.js",
66
"files": [

src/core

Submodule core updated 1 file

0 commit comments

Comments
 (0)