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

Ionic2: ion-input Issue with label not floating up when type is a number and value is 0 #8019

Closed
keithdmoore opened this issue Sep 8, 2016 · 7 comments

Comments

@keithdmoore
Copy link
Contributor

If you have an ion-input element with type="number". When the model changes to zero, the label does not float up.

I expect the label to float up.

Steps to reproduce:

  1. Click on Calculate button
  2. A zero is populated in the input
  3. The label and the input are on top of each other.
    <form [ngFormModel]="weightForm" novalidate>
      <ion-item>
        <ion-label floating>Weight</ion-label>
        <ion-input type="number" ngControl="weight" [(ngModel)]="weightModel"></ion-input>
      </ion-item>
      <button secondary (click)="calculateWeight()">Calculate</button>
    </form>

Here is the plunker that demonstrates the issue:

http://plnkr.co/edit/TEWz3FtRTH1lWgXbWHNU?p=preview

Cordova CLI: 6.3.1
Gulp version: CLI version 3.9.1
Gulp local: Local version 3.9.1
Ionic Framework Version: 2.0.0-beta.11
Ionic CLI Version: 2.0.0-beta.37
Ionic App Lib Version: 2.0.0-beta.20
ios-deploy version: 1.8.5
ios-sim version: 3.1.1
OS: Mac OS X El Capitan
Node Version: v5.8.0
Xcode version: Xcode 7.3.1 Build version 7D1014

@jgw96
Copy link
Contributor

jgw96 commented Sep 8, 2016

Thanks for the plunker! Note to self/team: the input-has-focus class is not applied when the input is initialized with 0.

@keithdmoore
Copy link
Contributor Author

Not initialized to zero but set to zero dynamically

@keithdmoore
Copy link
Contributor Author

Just merge the PR

@jgw96
Copy link
Contributor

jgw96 commented Sep 9, 2016

Hello @keithdmoore thanks for posting a PR 😄 . There is currently a code freeze on master because of all the internal changes going on with the completely new AOT compile, tree shaking, and minifying build process we are working on. Because of this it may be a little while before your PR is merged, but be assured that we will be looking at it.

@keithdmoore
Copy link
Contributor Author

Ok. Thanks for letting me know. Cheers!

@manucorporat
Copy link
Contributor

@keithdmoore thanks a lot for the PR. But it could not longer be merged without conflict so I used your fix.

@keithdmoore
Copy link
Contributor Author

@manucorporat No problem. Thanks for working this one. Glad to see it is fixed. I will be able to remove my hack soon.

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