Akryum / Akryum/vue-virtual-scroller

enhancement: offset item based on itemsize when using scrollToIndex method

未關閉
#682 3 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
duplicate feature-request
主要語言
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 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。