Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FxLayoutAlign with media queries only work after resizing window in a production build #1397

Open
roldengarm opened this issue Mar 22, 2022 · 0 comments

Comments

@roldengarm
Copy link

roldengarm commented Mar 22, 2022

Bug Report

What is the expected behavior?

fxLayoutAlign and media queries work regardless of production or development build mode, immediately without resizing the window.

What is the current behavior?

In a production build, I have to resize the window before the mediaqueries are applied correct.

What are the steps to reproduce?

See StackBlitz . I expect the button to only be stretched to 100% width on an xs resolution. However, when you open this Stackblitz on a larger screen, it still appears 100% width. Only when you resize the window, and then back, it appears correctly.

I did find out that if I add fxLayout to a media query as well, it works as expected. I.e. this works:

<div fxLayout.xs="column" fxLayoutAlign.xs="start stretch">
  <button>Next</button>
</div>

However I don't understand why.

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

It is a bug that prevents me from using fxLayoutAlign and media queries.

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

See StackBlitz for versions included.

Is there anything else we should know?

Great work on this library, it helps me a lot. Hopefully this can be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant