Skip to content

Commit ab838b6

Browse files
authored
fix(collectionview): iOS fix to prevent error when itemTemplateSelector
returns non defined template (like android)
1 parent 93583ec commit ab838b6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/collectionview/index.ios.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,11 @@ export class CollectionView extends CollectionViewBase {
860860
if (selector) {
861861
type = selector.call(this, this.getItemAtIndex(indexPath.item), indexPath.item, this.items);
862862
}
863-
return type.toLowerCase();
863+
const result = type.toLowerCase();
864+
if (this._itemTemplatesInternal.has(result)) {
865+
return result;
866+
}
867+
return 'default';
864868
}
865869
getItemTemplateContent(index, templateType) {
866870
return this.getViewForViewType(ListViewViewTypes.ItemView, templateType);

0 commit comments

Comments
 (0)