Ionic-framework: ionic 2:<ion-select> is not triggering (change) action event. If I use <select> tag then the (change) action is working.

Created on 21 Aug 2016  路  16Comments  路  Source: ionic-team/ionic-framework

Note: If you are having problems formatting your issue please refer to this article on using markdown in Github:

https://guides.github.com/features/mastering-markdown/

Note: for support questions, please use one of these channels:

https://forum.ionicframework.com/
http://ionicworldwide.herokuapp.com/

Short description of the problem:

What behavior are you expecting?

Steps to reproduce:



    1. 2.
  1. 3.
insert any relevant code between the above and below backticks

Other information: (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc)

Which Ionic Version? 1.x or 2.x

Plunker that shows an example of your issue

For Ionic 1 issues - http://plnkr.co/edit/Xo1QyAUx35ny1Xf9ODHx?p=preview

For Ionic 2 issues - http://plnkr.co/edit/me3Uk0GKWVRhZWU0usad?p=preview

Run ionic info from terminal/cmd prompt: (paste output below)

Most helpful comment

The Ionic Select component does not emit a change event, but it does emit an ionChange event. Please refer to the Output Events section in the API documentation to find the Select component's events. Thanks!

All 16 comments

The Ionic Select component does not emit a change event, but it does emit an ionChange event. Please refer to the Output Events section in the API documentation to find the Select component's events. Thanks!

IonChange is working for me. Thank you Brandy.

Thanks Brandy.

Use this:

(ngModelChange)="someEvent($event)"

this works just fine if u are using [(ngModel)] for the

So why is this gone from the documentation?
https://i.imgur.com/sPTdT6x.png

@azarus Nice catch, they must have accidentally been undocumented. I've created an issue to get them added back here: https://github.com/driftyco/ionic-site/issues/1074

Still, it's not there.Can you please tell me the place to find the detail of ionChange event? @brandyscarney

You can use it the following way:

  <ion-select [(ngModel)]="gender" (ionChange)="onSelectChange($event)">
    <ion-option value="f">Female</ion-option>
    <ion-option value="m">Male</ion-option>
  </ion-select>

then in your page:

  onSelectChange(selectedValue: any) {
    console.log('Selected', selectedValue);
  }

This will be called every time the value of the select changes.

Yes, I know about that part.But I would like to use the real data type instead of any here selectedValue: any.Can you please tell me the data type of $event? @brandyscarney

Thanksa lot!! It is not in the documentation at this moment.

i would like to pass my department Id to Item change how can i trigger item id (ionChange)="onSelectedItem(item.Id)"..im getting undefined value please help me on this


Select Department


how can i get text of ion-select i don麓t know how to use attribute selectedtext

wow, this is a long time to leave ionChange undocumented.

ion-option should be listening for a status change when attribute "multiple" on select is set to true.

why $event = selected value? ($event.target.checked)
i need the $event object itself! ($event.stopPropagation() and stuff)

I am going to be locking this issue as the comments have strayed from the main issue which was resolved.

If you have concerns about the documentation please leave comments/reactions on the site issue: https://github.com/ionic-team/ionic-site/issues/1074

If you have questions on how to use the select component please view the API documentation and then ask on our forum or slack channel.

If you've found a bug or believe there should be a change to the select component please create a new issue on this repository and fill out the pre-populated template.

Thank you! 馃檪

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alexbainbridge picture alexbainbridge  路  3Comments

BilelKrichen picture BilelKrichen  路  3Comments

giammaleoni picture giammaleoni  路  3Comments

danbucholtz picture danbucholtz  路  3Comments

Macstyg picture Macstyg  路  3Comments