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

[v4.0.0-beta.12] show-when not working properly #15813

Closed
dylanvdmerwe opened this issue Sep 30, 2018 · 3 comments
Closed

[v4.0.0-beta.12] show-when not working properly #15813

dylanvdmerwe opened this issue Sep 30, 2018 · 3 comments
Assignees

Comments

@dylanvdmerwe
Copy link
Contributor

dylanvdmerwe commented Sep 30, 2018

Bug Report

Ionic Info

Ionic:

   ionic (Ionic CLI)          : 4.1.2 (C:\Users\Dylan van der Merwe\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework            : @ionic/angular 4.0.0-beta.12
   @angular-devkit/core       : 0.7.5
   @angular-devkit/schematics : 0.7.5
   @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     : none
   Cordova Plugins       : no whitelisted plugins (7 plugins total)

System:

   NodeJS : v8.11.3 (C:\Program Files\nodejs\node.exe)
   npm    : 6.4.1
   OS     : Windows 10

Describe the Bug
When testing on a browser, show-when is always displayed. In Chrome inspect the page, and change between iPhone and Pixel devices - I would expect that this handled correctly.

In the code below the show-when for ios is always displaying which is not right when testing in browser.
image

Related Code

 <ion-toolbar>
    <ion-buttons *ngIf='step > 1 && !checking && step < 3' slot='start'>
      <ion-show-when mode='ios'>
        <ion-button (click)='back()'>
          <ion-icon name='arrow-back' class='back-button-icon-ios'></ion-icon> Back
        </ion-button>
      </ion-show-when>
      <ion-show-when mode="android,windows,core,mobileweb">
        <ion-button (click)='back()'>
          <ion-icon name='arrow-back' class='back-button-icon-md'></ion-icon>
        </ion-button>
      </ion-show-when>
    </ion-buttons>

Expected Behavior
show-when should work properly when inspecting in a browser. Same behaviour expected for hide-when.

@ionitron-bot ionitron-bot bot added the triage label Sep 30, 2018
@manucorporat manucorporat self-assigned this Oct 2, 2018
@ionitron-bot ionitron-bot bot removed the triage label Oct 2, 2018
@OJ7
Copy link

OJ7 commented Oct 2, 2018

This seems to only be for "mode" which looks like it always evaluates to true. You can see here for hide-when that it is always hidden for "mode".

@dylanvdmerwe, I noticed in your example that you have mode="android,windows,core,mobileweb" which I think should be platform="android,windows,core,mobileweb"

@manucorporat
Copy link
Contributor

@OJ7 you are correct!

@ionitron-bot
Copy link

ionitron-bot bot commented Nov 1, 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 Nov 1, 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