fxHide doesn't work on page load
See original GitHub issueBug 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?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:11
- Comments:10 (2 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have the same issue, are you sure that the problem is fixed?
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
andfxLayout
each wantdisplay: flex
, andfxShow
andfxHide
each wantdisplay: 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.