Utilizing ng2-completer within my application has been a seamless experience so far. When users start entering text, it triggers an API call to fetch records from the server. However, I have encountered an issue where if the completer returns more than 50 entries, it ends up overlapping the entire screen. How can I limit the dropdown length to prevent this overlap?
Although I attempted to resolve this with the following CSS code, it did not yield the desired outcome.
.completer-dropdown {
overflow-y: auto !important;
max-height: 100px !important;
}
Below is a snippet of my HTML code:
<ng2-completer placeholder="Enter Your Locality Name" class="overlay" [dataService]="dataServiceForLocality" [minSearchLength]="3" [fieldTabindex]="2" [(ngModel)]="localityValue" (selected)="selectedLocality($event)" [textSearching]="'Please wait...'" formControlName="locality" style="height: 50px;" (keyup)="onKey($event.target.value)"></ng2-completer>
You can view a live example of this implementation here.