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 doesn't show item with 0 value #16170

Closed
Rob-Meijeren opened this issue Nov 1, 2018 · 5 comments · Fixed by #16476
Closed

Ion-select doesn't show item with 0 value #16170

Rob-Meijeren opened this issue Nov 1, 2018 · 5 comments · Fixed by #16476
Assignees

Comments

@Rob-Meijeren
Copy link

Rob-Meijeren commented Nov 1, 2018

Bug Report

Describe the Bug
When a value is bound to a ion-select-option through the square brackets the option with value 0 is not showing its text in the ion-select

Steps to Reproduce
Steps to reproduce the behavior:

  1. add a ion-select to your html with multiple options of which one has a value of 0 ([value]='0')
  2. when you select the option with value 0 the select doesn't display the text of this option

However it does work when you set the value with interpolation: value='{{ value }}'

Related Code
https://stackblitz.com/edit/github-brjr3o

Expected Behavior
even when you bind the value with the square brackets the 0 option should show when selected

@ionitron-bot ionitron-bot bot added the triage label Nov 1, 2018
@comfortme
Copy link

maybe related to #15420

@Rob-Meijeren
Copy link
Author

Rob-Meijeren commented Nov 9, 2018

Looks the same indeed but this is more on how the values are bound to the select-options.

@moose4lord
Copy link

moose4lord commented Nov 23, 2018

I see this issue too. The bare bones example mentioned by @brandyscarney in #15420 does seem to work, but when you add Angular data binding, it fails when you select the '0' option (meaning the select displays a blank string instead of '0'). This is my example:

<ion-item>
  <ion-label>Numbers</ion-label>
  <ion-select id="numberSelect" name="numberSelect"
    [(ngModel)]="numberSelect" (ionChange)="consoleLog(numberSelect)">
    <ion-select-option [value]="0">0</ion-select-option>
    <ion-select-option [value]="1">1</ion-select-option>
    <ion-select-option [value]="2">2</ion-select-option>
    <ion-select-option [value]="3">3</ion-select-option>
    <ion-select-option [value]="4">4</ion-select-option>
    <ion-select-option [value]="5">5</ion-select-option>
  </ion-select>
</ion-item>

My ionic info:

ionic (Ionic CLI) : 4.4.0 (/usr/local/lib/node_modules/ionic)
Ionic Framework : @ionic/angular 4.0.0-beta.16
@angular-devkit/build-angular : 0.10.6
@angular-devkit/schematics : 7.0.6
@angular/cli : 7.0.6
@ionic/angular-toolkit : 1.2.0

@brandyscarney
Copy link
Member

Thanks for the issue! I can confirm this bug exists for the Ionic select and not the native select. We will look into this.

@ionitron-bot
Copy link

ionitron-bot bot commented Jan 6, 2019

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 Jan 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants