ionic2-autocomplete
ionic2-autocomplete copied to clipboard
On selecting on of the suggested items the background model also get selected this issue only in android device
**search.html **
<ng-template #withCode let-attrs="attrs"> <span [innerHTML]="attrs.data.name | boldprefix:attrs.keyword"></span> - <span [innerHTML]="attrs.data.code | boldprefix:attrs.keyword"></span> </ng-template> <ion-auto-complete id="search" [dataProvider]="statinAutoComp" formControlName = "fromStation" [options]="{ placeholder : 'From Station',debounce:400 }" [template]="withCode" [hideListOnSelection]='true'> </ion-auto-complete>
search.module.ts
@NgModule({ declarations: [ TrainSearchPage, ], imports: [ AutoCompleteModule, IonicPageModule.forChild(TrainSearchPage), ] })
search.ts
Constructor
` constructor(public navCtrl: NavController, public loadingCtrl:LoadingController, public alertCtrl:AlertController, public datepipe:DatePipe, public modalCtrl:ModalController, public completeTestService:CompleteTestService, public saveService:SaveSearchesService, public statinAutoComp:StationAutoComplete ) {
}`
please help me
Hey kadoshms please help me to resolve this issue.
Hello!
I change the "tap" event to "click" on template directive and remove second param "stopPropagation";
"ionic2-auto-complete/index.js"
before: (tap)="select(suggestion);$event.srcEvent.stopPropagation()"
after: (click)="select(suggestion);"
works fine in Android and IOS
Hello, I made following changes in module that is in "ionic2-auto-complete/index.js" for this issue (click)="select(suggestion);$event.stopPropagation();">\n
It worked fine with regular build.Though when I use prod build for my app this issue pops up again. Can anybody help me to resolve this?
Hi, This change in the module that is in "ionic2-auto-complete/index.js" is causing the issue in creating CI-CD build pipeline where every time new modules get installed while building the app and this is how the change in index.js made locally can not work for me. can anyone help in this?