ionic2-autocomplete
ionic2-autocomplete copied to clipboard
Bug: ngModel doesn't update on 'clear'
When I click the clear button (x) on the underlying searchbar component ngModel doesn't clear accordingly.
The same occurs with formControl
anyone has the quick fix for this ?
Same issue here, any updates?
Sorry , What ?
On Wed, Apr 4, 2018 at 10:40 PM, Pablo García Miranda < [email protected]> wrote:
Same issue here, any updates?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kadoshms/ionic2-autocomplete/issues/125#issuecomment-378675235, or mute the thread https://github.com/notifications/unsubscribe-auth/Adk-V5709T3JtiIl-xUcqNa6eIATa11Zks5tlP6VgaJpZM4Qdqfh .
--
[image: GoFenice Technologies] http://www.gofenice.com/
Shiyas / Project [email protected] / +919995512949
GoFenice TechnologiesOsmaniya Tower , First FloorKamaleswaram , Manacaud 695009 , Trivandrumwww.gofenice.com
[image: Facebook] https://www.facebook.com/gofenice/?fref=ts [image: Skype] https://htmlsig.com/skype?username=gofenice.tech [image: Stack Overflow] http://stackoverflow.com/users/5159726/gofenice-technologies?tab=profile
Same Issue I am using in form-group and it is not clear, showing previous data.
+1
+1
Workaround:
<ion-auto-complete #autoComplete (ionAutoInput)="onAutoCompleteChanges()">
</ion-auto-complete>
@ViewChild('autoComplete') autoComplete: AutoCompleteComponent;
onAutoCompleteChanges() {
setTimeout(() => {
if (!this.autoComplete.keyword) {
this.form.get('...').setValue(null);
}
}, 500);
}
setTimeout
is very important here.