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.

fxLayoutAlign="center center" bug?

See original GitHub issue

Bug 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:closed
  • Created 4 years ago
  • Reactions:4
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
rannysancommented, Feb 20, 2020

I had the same problem here, but when I removed *ngIf directive it worked fine, If you put the *ngIf in a div tag instead ng-container it will work as well.

Actually, I realized if the *ngIf is in the same tag that contains fxLayoutAlign it won’t work.

Anyone else knows if there is any workaround for this issue?

1reaction
nileshverma89commented, Feb 21, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

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