question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug: <ion-select> fires ionChange event twice

See original GitHub issue

Bug Report

Ionic version: [ ] 1.x [ ] 2.x [] 3.x [X] 4.x [X] 5.x

Current behavior: for <ion-select (ionChange)=“changed($event)”> the changed method is being called twice for each change

Expected behavior: the (ionChange)="changed($event) should be called once for each value change

Steps to reproduce: below code will log the select value has changed twice each time new select option has been selected

Related code:

insert short code snippets here
<ion-label position="stacked">Employee</ion-label>                        
                      <ion-select formControlName="empid" (ionChange)="empdetails($event);">
                          <ion-select-option *ngFor="let emp of emplist" [value]="emp.Id">{{emp.Name}}</ion-select-option>
                      </ion-select>

**Other information:**
<!-- List any other information that is relevant to your issue. Stack traces, related issues, suggestions on how to fix, Stack Overflow links, forum links, etc. -->

**Ionic info:**
<!-- (run `ionic info` from a terminal/cmd prompt and paste output below): -->

insert the output from ionic info here Ionic:

Ionic CLI : 5.2.3 (C:\Users\Admin\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : @ionic/angular 5.0.5 @angular-devkit/build-angular : 0.803.25 @angular-devkit/schematics : 8.3.25 @angular/cli : 8.3.25 @ionic/angular-toolkit : 2.2.0

Cordova:

Cordova CLI : 8.1.2 (cordova-lib@8.1.1) Cordova Platforms : android 8.1.0, browser 5.0.4 Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.1.3, (and 10 other plugins)

Utility:

cordova-res : 0.6.0 native-run : 0.2.8

System:

Android SDK Tools : 26.1.1 (C:\Program Files (x86)\Android\android-sdk) NodeJS : v10.15.3 (C:\Program Files\nodejs\node.exe) npm : 6.11.3 OS : Windows 10

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
liamdebeasicommented, Mar 31, 2020

Thanks for the issue. Can you provide a repo with the code required to reproduce this issue? I am unable to reproduce the issue using the code provided.

0reactions
ionitron-bot[bot]commented, Apr 23, 2020

Thanks for the issue! This issue is being closed due to the lack of a reply. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

Thank you for using Ionic!

Read more comments on GitHub >

github_iconTop Results From Across the Web

bug: <ion-select> fires ionChange event twice #20920 - GitHub
Make you sure you aren't changing the value of 'empid' form control somewhere. If you are, then it will fire again.
Read more >
ion-toggle ionChange get called multiple times in ionic
yeah it sounds like its not that ionChange fires multiple times its the "data" changing which in turn causes ionChange to fire in...
Read more >
Ion-toggle (ionChange) triggered - Ionic Framework
Ion-select unnecessarily triggers `ionChange` event when manually ... This has been a fairly persistent and stubborn bug dating all the way ...
Read more >
SCR19: Using an onchange event on a select element ... - W3C
The objective of this technique is to demonstrate how to correctly use an onchange event with a select element to update other elements...
Read more >
@ionic/angular | Yarn - Package Manager
Bug Fixes. datetime: reinit behavior on presentation change (#24828 (d46e1e8); tabs: angular, fire willChange event before selected tab changes (#24910 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found