ionic2-autocomplete icon indicating copy to clipboard operation
ionic2-autocomplete copied to clipboard

Bug: ngModel doesn't update on 'clear'

Open dzamula opened this issue 7 years ago • 7 comments

When I click the clear button (x) on the underlying searchbar component ngModel doesn't clear accordingly.

dzamula avatar Nov 14 '17 16:11 dzamula

The same occurs with formControl

CeloGomesBR avatar Jan 02 '18 04:01 CeloGomesBR

anyone has the quick fix for this ?

gofenice avatar Apr 04 '18 05:04 gofenice

Same issue here, any updates?

pablogarciamiranda avatar Apr 04 '18 17:04 pablogarciamiranda

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

gofenice avatar Apr 05 '18 07:04 gofenice

Same Issue I am using in form-group and it is not clear, showing previous data.

gaurishrane avatar Apr 06 '18 14:04 gaurishrane

+1

JeongJun-Lee avatar Jul 14 '18 07:07 JeongJun-Lee

+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.

allanpoppe avatar Aug 16 '18 04:08 allanpoppe