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

Placeholder not displayed for ion-select due to strict type checking #15605

Closed
admdly opened this issue Sep 15, 2018 · 2 comments
Closed

Placeholder not displayed for ion-select due to strict type checking #15605

admdly opened this issue Sep 15, 2018 · 2 comments
Assignees

Comments

@admdly
Copy link

admdly commented Sep 15, 2018

Bug Report

Ionic Info

Ionic:

   ionic (Ionic CLI)          : 4.1.2 (/usr/local/lib/node_modules/ionic)
   Ionic Framework            : @ionic/angular 4.0.0-beta.11
   @angular-devkit/core       : 0.8.2
   @angular-devkit/schematics : 0.8.2
   @angular/cli               : 6.1.5
   @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
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.2, cordova-plugin-ionic-webview 2.1.0, (and 8 other plugins)

System:

   NodeJS : v10.10.0 (/usr/local/Cellar/node/10.10.0/bin/node)
   npm    : 6.4.1
   OS     : macOS High Sierra
   Xcode  : Xcode 9.4.1 Build version 9F2000

Describe the Bug
Placeholders are not displayed for ion-select components in certain situations using forms. This began with ba22305 and is due to strict checking the selectText variable.

I haven't yet pinned down the specifics of when this occurs due to time restrictions and complex use of formBuilder which may be a contributing factor. However, I can confirm that specifying a form control with an initial value of 'undefined' ends up with an actual value of type 'null', which prevents the placeholder from being displayed.

Forcing the value to be undefined, with setValue(undefined) on the control enables the placeholder to be shown.

Expected Behavior
The placeholder specified for the ion-select component should be shown when no value is selected.

@ionitron-bot ionitron-bot bot added the triage label Sep 15, 2018
@brandyscarney brandyscarney self-assigned this Sep 18, 2018
@ionitron-bot ionitron-bot bot removed the triage label Sep 18, 2018
@brandyscarney
Copy link
Member

Thanks for the issue! I pushed a fix to change our checks from === undefined to == null. I believe this should fix the problem but if you are able to provide a way for us to reproduce this for you I can be certain of it.

If it is still an issue in 4.0.0-beta.12 I will reopen this. Thank you!

@ionitron-bot
Copy link

ionitron-bot bot commented Oct 18, 2018

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 Oct 18, 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

2 participants