fxLayoutAlign="center center" bug?
See original GitHub issueBug Report
What is the expected behavior?
Expects max-width 33%
What is the current behavior?
i have the current code
<div fxLayout="row">
<!-- some code ... -->
<ng-container*ngIf="someExp">
<div fxFlex="33%" fxFlex.lt-md="100%" fxLayoutAlign="center center" fxLayoutAlign.lt-md="start">
when the exp throws true, then de div flexs in a 100% when I declare it in 33% in all screen sizes
i remove fxLayoutAlign="center center"
then works great, my fix was declare a css class with max-width: 33%
and apliying ngClass.gt-md="w-33"
class
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Angular 9 and flex-layout 9
Is there anything else we should know?
I upgrade the angular core version from 8 to 9, in 8 that works fine, but in 9 occurs the behavior
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:7 (3 by maintainers)
Top Results From Across the Web
fxLayoutAlign center does not set align-items - GitHub
Bug Report What is the expected behavior? fxLayoutAlign="center" should set "align-items: center; align-content: center" What is the current ...
Read more >angular - FxLayoutAlign center is working - Stack Overflow
I am using material angular and using below code but make center <div fxLayout="column" ...
Read more >Angular Flexlayouts Sample - StackBlitz
Starter project for Angular apps that exports to the Angular CLI.
Read more >angular/flex-layout - Gitter
Hi there! I'm using flex-layout together with data-tables. The table is rather packed and I am facing two problems there. 1) The columns...
Read more >Angular Flex Layout: The Masquerade | by Aleix Suau - Medium
fxLayoutAlign cross-axis (align-content) only admits flex-start, center, flex-end and stretch options, so we can't apply space-between or space-around in the ...
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 had the same problem here, but when I removed
*ngIf
directive it worked fine, If you put the*ngIf
in adiv
tag insteadng-container
it will work as well.Actually, I realized if the
*ngIf
is in the same tag that containsfxLayoutAlign
it won’t work.Anyone else knows if there is any workaround for this issue?
We have the same issue, previously it was working, and once we upgraded to angular 9, flex-layout 9 we got the same issue. @rannysan solution work but we have lots of div and it’s not feasible to remove *ngIf from all of them.