fix(virtual-scroll): use correct item top calculation with header or footer function (#15948) (#17345)

- use the right index in updateVDom to update the top transition ()
- extend unit test to verify the top is also calculated right with a given headerFn and footerFn
- update the visibility of the node also if a given approxHeaderHeight/approxFooterHeight matches the calculated height

fixes #15948 fixes #17298
This commit is contained in:
David Boho
2019-03-26 21:17:03 +01:00
committed by Brandy Carney
parent 016fa16d44
commit a8a48a4ca4
3 changed files with 14 additions and 9 deletions

View File

@ -46,7 +46,7 @@ export function updateVDom(dom: VirtualNode[], heightIndex: Uint32Array, cells:
for (const cell of toMutate) {
const node = pool.find(n => n.d && n.cell.type === cell.type);
const index = cell.index;
const index = cell.i;
if (node) {
node.d = false;
node.change = NODE_CHANGE_CELL;