Skip to content

Commit 2afa473

Browse files
author
Andrea Barbasso
committed
[DURACOM-224] fix infinite scroll
1 parent a59f371 commit 2afa473

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

src/app/shared/dso-selector/dso-selector/dso-selector.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
[formControl]="input" ngbAutofocus (keyup.enter)="selectSingleResult()">
77
</div>
88
<div class="dropdown-divider"></div>
9-
<div class="scrollable-menu list-group">
9+
<div id="scrollable-menu-dso-selector-{{randomSeed}}" class="scrollable-menu list-group">
1010
<div
1111
infiniteScroll
1212
[infiniteScrollDistance]="1"
1313
[infiniteScrollThrottle]="0"
14-
[infiniteScrollContainer]="'.scrollable-menu'"
14+
[infiniteScrollContainer]="'#scrollable-menu-dso-selector-' + randomSeed"
1515
[fromRoot]="true"
1616
(scrolled)="onScrollDown()">
1717
<ng-container *ngIf="listEntries$ | async">

src/app/shared/dso-selector/dso-selector/dso-selector.component.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,11 @@ export class DSOSelectorComponent implements OnInit, OnDestroy {
136136
*/
137137
public subs: Subscription[] = [];
138138

139+
/**
140+
* Random seed of 4 characters to avoid duplicate ids
141+
*/
142+
randomSeed: string = Math.random().toString(36).substring(2, 6);
143+
139144
constructor(
140145
protected searchService: SearchService,
141146
protected notifcationsService: NotificationsService,

0 commit comments

Comments
 (0)