flex-layout icon indicating copy to clipboard operation
flex-layout copied to clipboard

fxShow not working

Open whyao opened this issue 9 years ago • 5 comments

Hey, I tried to use fxShow in one of your examples and it doesn't seem to be working properly. fxHide works when I do:

fxHide.xs="true"

but fxShow doesn't work when I do:

fxShow.gt-xs="true"

<button class="nav-trigger" 
            (click)="toggleMenu()" 
            color="primary" 
            md-icon-button>
     Toggle Button
</button>

<div [fxShow]="menuOpen"
     fxShow.xs="true"
     style="margin-top:25px;background-color:#d9edf7">
  I should hide and show
</div>  

https://plnkr.co/edit/3SKnjiop1QSXZaKjxHAQ?p=preview

whyao avatar Mar 14 '17 03:03 whyao

See the same issue with next markup:

<span fxShow [fxShow.gt-xs]="true">Visible on desktop</span>

Do I use it right? Btw @whyao your code looks different to documentation.

bobrosoft avatar Mar 14 '17 14:03 bobrosoft

Next code is working:

<span fxHide [fxHide.gt-xs]="false">Visible on desktop</span>

I think there's some confusion in documentation language or need more examples... Explanation for example above: fxHide will hide element for all sizes, [fxHide.gt-xs]="false" will not hide element for gt-xs. Rules applied from left to right, following rules overrides previous ones.

bobrosoft avatar Mar 14 '17 14:03 bobrosoft

Opposite example:

<span fxShow [fxShow.gt-xs]="false">Visible on mobile</span>

I think all is working btw, not a bug. @ThomasBurleson can you confirm?

bobrosoft avatar Mar 14 '17 15:03 bobrosoft

@whyao - this is working with the latest code in HEAD (on master).

  • Working Plunkr
    • Do not use FlexLayoutModule.forRoot()... use FlexLayoutModule
    • To use the latest build code (pre-release), update your config
      • '@angular/flex-layout' : 'https://rawgit.com/angular/flex-layout-builds/master/bundles/flex-layout.umd.js'

NEW Wiki Documentation: fxShow/fxHide

ThomasBurleson avatar Mar 16 '17 14:03 ThomasBurleson

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.