Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix infinite scroll #2768

Merged
merged 1 commit into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
[formControl]="input" ngbAutofocus (keyup.enter)="selectSingleResult()">
</div>
<div class="dropdown-divider"></div>
<div class="scrollable-menu list-group">
<div id="scrollable-menu-dso-selector-{{randomSeed}}" class="scrollable-menu list-group">
<div
infiniteScroll
[infiniteScrollDistance]="1"
[infiniteScrollThrottle]="0"
[infiniteScrollContainer]="'.scrollable-menu'"
[infiniteScrollContainer]="'#scrollable-menu-dso-selector-' + randomSeed"
[fromRoot]="true"
(scrolled)="onScrollDown()">
<ng-container *ngIf="listEntries$ | async">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@ export class DSOSelectorComponent implements OnInit, OnDestroy {
*/
public subs: Subscription[] = [];

/**
* Random seed of 4 characters to avoid duplicate ids
*/
randomSeed: string = Math.random().toString(36).substring(2, 6);

constructor(
protected searchService: SearchService,
protected notifcationsService: NotificationsService,
Expand Down
Loading