Skip to content

Commit 8260a01

Browse files
committed
fix: looping error
1 parent 9ef26bd commit 8260a01

File tree

5 files changed

+7
-8
lines changed

5 files changed

+7
-8
lines changed

.github/workflows/npm-publish.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ jobs:
1313
with:
1414
node-version: 18
1515
registry-url: https://registry.npmjs.org/
16+
- run: npm i
1617
- run: npm publish
1718
env:
1819
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

dist/virtual-list.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* vue-virtual-sortable v2.0.2
2+
* vue-virtual-sortable v2.0.3
33
* open source under the MIT license
44
* https://github.com/mfuu/vue-virtual-sortable#readme
55
*/
@@ -1925,9 +1925,8 @@
19251925
return;
19261926
}
19271927
var sizes = this.virtualRef.sizes.size;
1928-
var renders = Math.min(this.keeps, this.dataSource.length);
19291928
this.virtualRef.onItemResized(key, size);
1930-
if (sizes === renders - 1) {
1929+
if (sizes === this.keeps - 1 && this.dataSource.length > this.keeps) {
19311930
this.virtualRef.updateRange(this.range);
19321931
}
19331932
},

dist/virtual-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-sortable",
3-
"version": "2.0.2",
3+
"version": "2.0.3",
44
"description": "A virtual scrolling list component that can be sorted by dragging",
55
"main": "dist/virtual-list.min.js",
66
"files": [

src/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,10 +302,9 @@ const VirtualList = Vue.component('virtual-list', {
302302
}
303303

304304
const sizes = this.virtualRef.sizes.size;
305-
const renders = Math.min(this.keeps, this.dataSource.length);
306305
this.virtualRef.onItemResized(key, size);
307306

308-
if (sizes === renders - 1) {
307+
if (sizes === this.keeps - 1 && this.dataSource.length > this.keeps) {
309308
this.virtualRef.updateRange(this.range);
310309
}
311310
},

0 commit comments

Comments
 (0)