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

Comments

@Rob-Meijeren
Copy link

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

This comment has been minimized.

Copy link

commented Nov 2, 2018

maybe related to #15420

@Rob-Meijeren

This comment has been minimized.

Copy link
Author

commented Nov 9, 2018

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

@moose4lord

This comment has been minimized.

Copy link

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 brandyscarney added this to Backlog 🤖 in Ionic Core via automation Nov 26, 2018

@ionitron-bot ionitron-bot bot removed the triage label Nov 26, 2018

@brandyscarney

This comment has been minimized.

Copy link
Member

commented Nov 26, 2018

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

manucorporat added a commit that referenced this issue Nov 27, 2018

Ionic Core automation moved this from Backlog 🤖 to Done 🎉 Nov 27, 2018

manucorporat added a commit that referenced this issue Nov 27, 2018

@manucorporat manucorporat self-assigned this Dec 6, 2018

@ionitron-bot

This comment has been minimized.

Copy link

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.
5 participants
You can’t perform that action at this time.