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

bug: ion-radio doesn't selected default value if number #5660

Closed
JumBay opened this issue Mar 1, 2016 · 1 comment
Closed

bug: ion-radio doesn't selected default value if number #5660

JumBay opened this issue Mar 1, 2016 · 1 comment
Assignees
Milestone

Comments

@JumBay
Copy link

JumBay commented Mar 1, 2016

Short description of the problem:

Create ion-radio where values are number. Set a default number value for the model, none radio will be selected.

Steps to reproduce:

@Page({
    templateUrl: 'build/pages/page1/page1.html',
})
export class Page1 {
    selectedTime:number=60;
}
<ion-list radio-group [(ngModel)]="selectedTime">
  <ion-list-header>
    Time
  </ion-list-header>
  <ion-item>
    <ion-label>60 minutes</ion-label>
    <ion-radio value="60"></ion-radio>
  </ion-item>
  <ion-item>
    <ion-label>30 minutes</ion-label>
    <ion-radio value="30"></ion-radio>
  </ion-item>
</ion-list>

Radio 60 minutes should be selected

Ionic Version: 2.x

Browser & Operating System: iOS / Android / Chrome

Run ionic info from terminal/cmd prompt:

Your system information:

Cordova CLI: 6.0.0
Gulp version:  CLI version 3.9.1
Gulp local:
Ionic Version: 2.0.0-beta.1
Ionic CLI Version: 2.0.0-beta.17
Ionic App Lib Version: 2.0.0-beta.8
ios-deploy version: 1.8.5
ios-sim version: 5.0.6
OS: Mac OS X El Capitan
Node Version: v5.6.0
Xcode version: Xcode 7.2.1 Build version 7C1002
@adamdbradley
Copy link
Contributor

Good catch, yeah we should use === for value comparisons. Thanks for the report!

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 7, 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