Skip to content
This repository has been archived by the owner on Jun 1, 2024. It is now read-only.

fix list view id #258

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/components/beagle-list-view/beagle-list-view.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,18 +97,19 @@ export class BeagleListViewComponent
const contextId = this.getIteratorName()
const listViewTag = element._beagleComponent_.toLowerCase()
const listViewId = element.id
const renderer = this.getViewContentManager().getView().getRenderer()

// @ts-ignore: at this point, element.children won't have ids and it's ok.
element.children = this.dataSource.map((item, index) => {
const child = Tree.clone(this.template)
const child = renderer.preProcess(Tree.clone(this.template))
const iterationKey = this.key && item[this.key] !== undefined ? item[this.key] : index
child._implicitContexts_ = [{ id: contextId, value: item }]
this.assignIdsToListViewContent(child, iterationKey, listViewId, listViewTag)
return child
})

this.currentlyRendered = JSON.stringify(this.dataSource)
this.getViewContentManager().getView().getRenderer().doFullRender(element, element.id)
renderer.doFullRender(element, element.id)

/* If the dataSource comes from a context, it might be initially empty, so the closes
scroll is one, when the data actually comes, the closes scroll may change, so to guarantee
Expand Down