Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ion-select returns model value as array instead of string #11337

Closed
vazad28 opened this issue Apr 24, 2017 · 3 comments
Closed

Ion-select returns model value as array instead of string #11337

vazad28 opened this issue Apr 24, 2017 · 3 comments
Assignees

Comments

@vazad28
Copy link

vazad28 commented Apr 24, 2017

Ionic version: (check one with "x")
[ ] 1.x
[ ] 2.x
[x ] 3.x

I'm submitting a ... (check one with "x")
[x ] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/

Current behavior:
On device and emulator, the ion-select return the model value as an array, while on chrome it returns the model value as string.

Expected behavior:
The model value should be string

Steps to reproduce:
Should be self descriptive from above.

Related code:

<ion-label>Select Template</ion-label>
<ion-select (ionChange)="loadCaseTemplate()" [(ngModel)]="selectedTmplKey"	multiple="false" [selectOptions]="{title:'Select Template'}">
	<ion-option *ngFor="let tmpl of templateService.surgeryTemplates$ | async" [value]="tmpl.id">{{tmpl.data.title}}</ion-option>
</ion-select>

Other information:

Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):

Cordova CLI: 6.5.0 
Ionic Framework Version: 3.0.1
Ionic CLI Version: 2.2.3
Ionic App Lib Version: 2.2.1
Ionic App Scripts Version: 1.3.4
ios-deploy version: 1.9.0 
ios-sim version: 5.0.13 
OS: macOS Sierra
Node Version: v7.2.0
Xcode version: Xcode 8.2 Build version 8C38
@manucorporat manucorporat self-assigned this Apr 24, 2017
@jgw96 jgw96 added the v2 label Apr 24, 2017
@jgw96
Copy link
Contributor

jgw96 commented Apr 24, 2017

Hello, thanks for using Ionic, we will look into this.

@CooleyGit
Copy link

CooleyGit commented Apr 24, 2017

Seeing the same issue just updated to nightly 3.0.1-201704241659 and all my forms that were passing value as a string are now passing array.

<ion-select formControlName="room_id" [(ngModel)]="invRoomModel.room_id">       
    <ion-option *ngFor="let room of inventoryRooms$ | async" 
                         [value]="room.id">{{room.name}}</ion-option>                  
 </ion-select>

@ionitron-bot
Copy link

ionitron-bot bot commented Sep 3, 2018

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. 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.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants