File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import { NgControl } from '@angular/forms';
4
4
import { Config } from '../../config/config' ;
5
5
import { BaseInput } from '../../util/base-input' ;
6
6
import { isPresent , isTrueProperty } from '../../util/util' ;
7
+ import { TimeoutDebouncer } from '../../util/debouncer' ;
7
8
import { Platform } from '../../platform/platform' ;
8
9
9
10
/**
@@ -63,6 +64,7 @@ export class Searchbar extends BaseInput<string> {
63
64
_isActive : boolean = false ;
64
65
_showCancelButton : boolean = false ;
65
66
_animated : boolean = false ;
67
+ _inputDebouncer : TimeoutDebouncer = new TimeoutDebouncer ( 0 ) ;
66
68
67
69
/**
68
70
* @input {string} Set the the cancel button text. Default: `"Cancel"`.
@@ -89,6 +91,7 @@ export class Searchbar extends BaseInput<string> {
89
91
}
90
92
set debounce ( val : number ) {
91
93
this . _debouncer . wait = val ;
94
+ this . _inputDebouncer . wait = val ;
92
95
}
93
96
94
97
/**
@@ -288,7 +291,9 @@ export class Searchbar extends BaseInput<string> {
288
291
*/
289
292
inputChanged ( ev : any ) {
290
293
this . value = ev . target . value ;
291
- this . ionInput . emit ( ev ) ;
294
+ this . _inputDebouncer . debounce ( ( ) => {
295
+ this . ionInput . emit ( ev ) ;
296
+ } ) ;
292
297
}
293
298
294
299
/**
You can’t perform that action at this time.
0 commit comments