Holiday Notice: Support will be provided on a limited scale from December 24th, 2024, to January 2nd, 2025. Happy holidays and a wonderful New Year!


Topic: Autocomplete search looks for value in datasource before it has been updated

University of St Andrews pro asked 6 years ago


So the issue here is that when i type something in the input it looks for it in the local datasource which has not been updated because it is still fetching data from the backend. Now, once i have the source populated my next searches will start looking for items in the existing source instead of waiting for the source to be re-populated.   Is there a way to call the lookup manually after the source have been populated?
<mdb-autocomplete [label]="'Line manager'" name="lineManager"  [(ngModel)]="lineManagerStr" [datasource]="lineManagers"
                  (keyup)="subscribeToProfileSearch()">
</mdb-autocomplete>

    this.appService.getObject('searchProfile/' + this.lineManagerStr).subscribe(data => {
      this.lineManagers = this.completerService.local(data, 'label', 'label');

    });
  Another behavior: it calls the onkeyup callback twice for each keypress. Also i am using the version 6.2.3 but the support dropdown does not have that option.

Damian Gemza staff commented 6 years ago

Dear UoStA_ajdi, Could you please provide me with a reproduction example, on which I'll be able to reproduce your problem? This would help me a lot. If it's possible, please send it to me at d.gemza@mdbootstrap.com Best Regards, Damian


Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Opened

Specification of the issue

  • ForumUser: Pro
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: 6.2.2
  • Device: PC
  • Browser: Firefox
  • OS: Windows
  • Provided sample code: No
  • Provided link: No