question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

fxHide doesn't work on page load

See original GitHub issue

Bug Report

What is the expected behavior?

fxHide must hide the content on page load.

What is the current behavior?

It doesn’t work as expected on page load.

What are the steps to reproduce?

https://stackblitz.com/edit/angular-gqvksp

<div fxHide fxShow.gt-sm>

  <div fxLayout="row" fxLayoutAlign="start center" fxFlex="0 1 auto">

      This content doesn't get hidden on small screen size!

  </div>
  
</div>

There is no fxLayout on the parent element, and because of that, fxFlex puts display: flex to the parent item in order to work correctly and that overrides the display: none from fxHide.

If I put fxLayout="row" to the parent element, fxHide works as expected. It also works correctly when resizing the window.

What is the use-case or motivation for changing an existing behavior?

It’s a bug.

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

flex-layout 6.0.0-beta.17 & beta.18, Angular 6.x, Chrome (MacOS), Firefox (MacOS) & Safari (MacOS)

Is there anything else we should know?

Related issues: #812 , #814

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:11
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

6reactions
HighSoftWare96commented, Jan 21, 2019

I have the same issue, are you sure that the problem is fixed?

3reactions
CaerusKarucommented, Oct 23, 2018

This is a very unfortunate issue, not just because of the UX, but because it’s a tricky fix. We have a case of competing directives, each with their own stake on the CSS display property: fxFlex and fxLayout each want display: flex, and fxShow and fxHide each want display: none or to set the display back to what it should be. There will need to be a design on the best way to regulate this, which I’ll start working on. I apologize for the inconvenience in the meantime.

Read more comments on GitHub >

github_iconTop Results From Across the Web

fxHide.gt-sm Not working - Stack Overflow
For some reason when I add the fxHide.gt-sm=true it doesn't hide when I make the screen smaller. How can I fix this?
Read more >
Best Practices for using Responsive Layouts - Neutrinos
Design testing for keyboard overflow: All input actions will trigger keyboard open, re-aligning, or pushing the layout.
Read more >
Angular Flex Layout: The Masquerade | by Aleix Suau - Medium
In this post I'll summarize the possibilities of flexbox and how Angular Flex Layout enrich and simplifies it with a cool declarative and...
Read more >
angular/flex-layout - Gitter
hi :) there appears to be an issue where fxHide.xs doesn't activate on very small screens, example width around 330px - I made...
Read more >
How to show/hide data when the particular condition is true in ...
News · Top News · Technology · Work & Career · Business ... We use cookies to ensure you have the best browsing...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found