kadoshms / ionic2-autocomplete

Ionic 2 autocomplete component
MIT License
149 stars 108 forks source link

On selecting on of the suggested items the background model also get selected this issue only in android device #163

Open AamirAlam opened 6 years ago

AamirAlam commented 6 years ago

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

AamirAlam commented 6 years ago

Hey kadoshms please help me to resolve this issue.

luistechio commented 6 years ago

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

SumeetHindinkeri commented 5 years ago

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?

rpragesh commented 4 years ago

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?