jrquick17 / ionic4-auto-complete

An auto complete compatible with Ionic 2+ and Angular 2+.
https://ionic4-auto-complete.jrquick.com
MIT License
49 stars 36 forks source link

[BUG]: 1 keystroke delay, emptyTemplate and selectionTemplate not working #44

Closed moneycoach2019 closed 4 years ago

moneycoach2019 commented 4 years ago

I'm submitting a

Description

It looks like there are a few bugs when using ionic5. Upon new load of the page, the autocomplete field takes atleast 1 keystroke in advance to register a change and apply the filter. Also the emptyTemplate and selection Templates are not working. The regular template does work.

Version Information

"@ag-grid-community/all-modules": "^22.1.1",
    "@angular/common": "~8.1.2",
    "@angular/core": "~8.1.2",
    "@angular/forms": "~8.1.2",
    "@angular/platform-browser": "~8.1.2",
    "@angular/platform-browser-dynamic": "~8.1.2",
    "@angular/router": "~8.1.2",
    "@ionic-native/core": "^5.19.1",
    "@ionic-native/splash-screen": "^5.19.1",
    "@ionic-native/status-bar": "^5.19.1",
    "@ionic/angular": "5.0.0-beta.1",
    "cordova-android": "8.1.0",
    "core-js": "^2.6.11",
    "ionic4-auto-complete": "^2.5.0",
    "rxjs": "^6.5.4",
    "tslib": "^1.9.0",
    "zone.js": "~0.9.1"

Browser

jrquick17 commented 4 years ago

Hey @moneycoach2019, can you share an example of emptyTemplate and/or selectionTemplate not working? It is working in the custom template demo, code here.

jrquick17 commented 4 years ago

Upon new load of the page, the autocomplete field takes atleast 1 keystroke in advance to register a change and apply the filter.

This bug has been fixed and will be in the next release.

moneycoach2019 commented 4 years ago

@jrquick17 Thanks for the bugfix, works now perfectly. Here the examples for emptyTemplate:

  <ng-template #empty let-attrs="attrs">
    <ion-text class="ion-text-right ion-padding-vertical">That country does not exist!</ion-text>
  </ng-template>

          <ion-auto-complete [(model)]="cryptoFrom" [dataProvider]="cryptoPairProvider" [template]="withSymbols" [emptyTemplate]="empty" [options]="{ placeholder : 'From:', debounce: 1 }" style="width:100%"></ion-auto-complete>