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

showWhen/hideWhen not working Beta 6 #6270

Closed
SP1966 opened this issue Apr 21, 2016 · 2 comments
Closed

showWhen/hideWhen not working Beta 6 #6270

SP1966 opened this issue Apr 21, 2016 · 2 comments
Assignees
Milestone

Comments

@SP1966
Copy link

SP1966 commented Apr 21, 2016

showWhen/hideWhen is not working.

showwhen

`
<ion-navbar *navbar primary hideBackButton>

<ion-buttons left>
    <button showWhen="android" (click)="onCancel()" >
      <ion-icon name="close"></ion-icon>
    </button>
    <button showWhen="ios" (click)="onCancel()" >Cancel</button>
  </ion-buttons>

  <ion-title>Add Location</ion-title>

 <ion-buttons end>
    <button showWhen="android" (click)="onSubmit()" >
      <ion-icon name="checkmark"></ion-icon>
    </button>
    <button showWhen="ios" (click)="onSubmit()" >Done</button>
</ion-buttons>


</ion-navbar>

`

Version 2 Beta 6

Cordova CLI: 6.0.0
Gulp version: CLI version 3.9.0
Gulp local: Local version 3.9.1
Ionic Framework Version: 2.0.0-beta.6
Ionic CLI Version: 2.0.0-beta.25
Ionic App Lib Version: 2.0.0-beta.15
ios-deploy version: 1.8.6
ios-sim version: 5.0.6
OS: Mac OS X El Capitan
Node Version: v5.1.0
Xcode version: Xcode 7.3 Build version 7D175

@brandyscarney
Copy link
Member

So I looked into this some more, and it is because the button's display property is taking precedence over the showWhen/hideWhen classes. As a temporary fix, you should be able to add the following css to your app.core.scss file (or any other sass file that comes after the ionic imports):

// Applied by the showWhen directive
.hidden-show-when {
  display: none !important;
}

// Applied by the hideWhen directive
.hidden-hide-when {
  display: none !important;
}

I'll work on fixing this in the framework. Thanks for the issue!

@SP1966
Copy link
Author

SP1966 commented Apr 21, 2016

Thanks once again Brandy, you're awesome!!

@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

3 participants