fix(virtual-scroll): fixes dynamic changes

This commit is contained in:
Manu MA
2018-12-19 00:27:04 +01:00
committed by GitHub
parent 320eb03168
commit d1cecf142b
11 changed files with 234 additions and 99 deletions

View File

@ -181,10 +181,14 @@ export function getShouldUpdate(dirtyIndex: number, currentRange: Range, range:
}
export function findCellIndex(cells: Cell[], index: number): number {
const max = cells[cells.length - 1].index || 0;
if (index === 0) {
return 0;
} else if (index === max + 1) {
return cells.length;
} else {
return cells.findIndex(c => c.index === index);
}
return cells.findIndex(c => c.index === index);
}
export function inplaceUpdate(dst: Cell[], src: Cell[], offset: number) {