mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 12:29:55 +08:00
fix(virtual-scroll): supports null records
fixes 11093
This commit is contained in:
@ -892,7 +892,7 @@ export function enableTouchControl(s: Slides) {
|
||||
// Cleanup dynamic styles
|
||||
function cleanupStyles(s: Slides) {
|
||||
if (!s.container || !s._wrapper) {
|
||||
//fix #10830
|
||||
// fix #10830
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -21,7 +21,7 @@ export function processRecords(stopAtHeight: number,
|
||||
let startRecordIndex: number;
|
||||
let previousCell: VirtualCell;
|
||||
let tmpData: any;
|
||||
let lastRecordIndex = (records.length - 1);
|
||||
let lastRecordIndex = records ? (records.length - 1) : -1;
|
||||
|
||||
if (cells.length) {
|
||||
// we already have cells
|
||||
@ -131,11 +131,11 @@ export function populateNodeData(startCellIndex: number, endCellIndex: number, v
|
||||
cells: VirtualCell[], records: any[], nodes: VirtualNode[], viewContainer: ViewContainerRef,
|
||||
itmTmp: TemplateRef<VirtualContext>, hdrTmp: TemplateRef<VirtualContext>, ftrTmp: TemplateRef<VirtualContext>,
|
||||
initialLoad: boolean): boolean {
|
||||
const recordsLength = records.length;
|
||||
if (!recordsLength) {
|
||||
if (!records || records.length === 0) {
|
||||
nodes.length = 0;
|
||||
return true;
|
||||
}
|
||||
const recordsLength = records.length;
|
||||
|
||||
let hasChanges = false;
|
||||
let node: VirtualNode;
|
||||
|
Reference in New Issue
Block a user