mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-23 05:58:26 +08:00
fix(virtual-scroll): fixes dynamic changes
This commit is contained in:
@ -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) {
|
||||
|
Reference in New Issue
Block a user