Ionic Info
```
Ionic:
ionic (Ionic CLI) : 4.1.2 (/usr/local/lib/node_modules/ionic)
Ionic Framework : @ionic/angular 4.0.0-beta.8
@angular-devkit/core : 0.8.1
@angular-devkit/schematics : 0.8.1
@angular/cli : 6.2.1
@ionic/ng-toolkit : 1.0.8
@ionic/schematics-angular : 1.0.6
Cordova:
cordova (Cordova CLI) : 8.0.0
Cordova Platforms : android 7.0.0, browser 5.0.4, ios 4.5.5
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.2, cordova-plugin-ionic-webview 2.0.3, (and 14 other plugins)
System:
Android SDK Tools : 26.1.1 (/Users/heb/Library/Android/sdk)
ios-deploy : 2.0.0
NodeJS : v10.10.0 (/usr/local/Cellar/node/10.10.0/bin/node)
npm : 6.4.1
OS : macOS
Xcode : Xcode 10.0 Build version 10L232m```
Describe the Bug
When using ion-input type text together with a FormControl where the initial value is empty (or null, undefined) then:
As soon as at least one value, even just a whitespace is added as initial value everything works fine. Also the placeholder text is displayed properly once the initial whitespace was removed.
Steps to Reproduce
Steps to reproduce the behavior:
Expected Behavior
The ion-input should behave the same both for empty string and undefined initial value.
Did you added the FormsModule to your module.ts ? Please upload a repository to check it because I have no problems with FormControl in combination with Ionic 4
@paulstelzer No, I can confirm that. I was to open that issue too.
It only happens when you have an initial null value for the FormControl of the ion-input. Then the shadow root tree have no control at all...
I can also tell it is a regression in @ionic/[email protected]. It does work correctly when pinning the versions of @ionic/core and @ionic/angular to 4.0.0-beta.7.
@paulstelzer Yep, as stated by @hebra. However, this is important to handle null values as before (that is when the field is not touched then a null value is kept).
Some StackBlitz with beta.7 that works: https://stackblitz.com/edit/angular-ionic-v4b7-ion-input.
The same with beta.8 can't even load because of some packaging problem of beta.8 (https://stackblitz.com/edit/angular-ionic-v4b8-ion-input for reference).
Anyway, just export the beta.7 version locally and change the @ionic/angular version to beta.8, and you'll see the problem.
Doesn't work with type text but is not working with other types, like password or email. Only works with type number in beta 8 if the initial value is null.
It seems that this issue is resolved by https://github.com/ionic-team/ionic/commit/83543b727b299c93ea60f96cc90ed48104eac4f3.
Can we have a release ?
If you cannot wait, just build it yourself - download the repo and run npm run build after installation of the node modules - but I think i new beta release will coming soon ;)
@paulstelzer Already did it! That's why I can tell this issue is fixed... :P
However I am unable to npm link @ionic/core and @ionic/angular (I have a strange error when running my app...). So this is a bit precarious as I manually copy the css, dist and loader directories to my node_modules directory.
I confirm that this is fixed in 4.0.0-beta.9. This issue can be closed.
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.
Most helpful comment
I confirm that this is fixed in
4.0.0-beta.9. This issue can be closed.