Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70612

Ionic 2 - ion-searchbar - searching only when enter is pressed?

$
0
0

@wlangiewicz wrote:

I have following piece of HTML code in Ionic 2 app:

<ion-searchbar [(ngModel)]="searchQuery" (input)="searchGIFs()" placeholder="Search"></ion-searchbar>

then i have my JS code:

searchGIFs() {
this.giphy.search(this.searchQuery).then(data => {
    this.gifs = data;
});

Right now SearchGIFs function is executed on each key press into the search field, but I'd like it to execute only when user finishes typing the query and presses "Enter".

How do I do that?

Posts: 4

Participants: 3

Read full topic


Viewing all articles
Browse latest Browse all 70612

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>