Akryum / Akryum/vue-virtual-scroller
enhancement: offset item based on itemsize when using scrollToIndex method
- 主要語言
- TypeScript
- 星號
- 10.8k
- 分支
- 973
- PR 合併指標
- 30 天內沒有已合併 PR
描述
I was running into issues where scrolling to an item index meant the item was not fully in the user's view (element was cut off). Updated `vue-virtual-scroller.esm.js ` below; not sure if the src code should be updated elsewhere but figured I would put this out for discussion at least.
```
scrollToItem (index) {
let scroll;
if (this.itemSize === null) {
scroll = index > 0 ? this.sizes[index - 1].accumulator : 0;
} else {
scroll = index * this.itemSize;
}
let { size } = this.sizes[index];
let offsetPosition = size ? scroll - size : scroll;
this.scrollToPosition(offsetPosition);
},
貢獻指南
這個儲存庫沒有索引到貢獻指南
評估
這個 Issue 還沒有評估資料。