mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
fix(list-view-android): app crashes on ListView item template change (#6634)
* fix(list-view): app crashes on first ListView item template change * tests: add tests for changing ListView item template with expression
This commit is contained in:
committed by
GitHub
parent
35ebe8b91d
commit
2085d1e4ac
@@ -66,6 +66,11 @@ export abstract class ListViewBase extends ContainerView implements ListViewDefi
|
||||
});
|
||||
this._itemTemplateSelector = (item: any, index: number, items: any) => {
|
||||
item["$index"] = index;
|
||||
|
||||
if (this._itemTemplateSelectorBindable.bindingContext === item) {
|
||||
this._itemTemplateSelectorBindable.bindingContext = null;
|
||||
}
|
||||
|
||||
this._itemTemplateSelectorBindable.bindingContext = item;
|
||||
return this._itemTemplateSelectorBindable.get("templateKey");
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user