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

fxLayout overrides and destroys existing display properties on screen width changes #1043

Closed
adamdport opened this issue Mar 28, 2019 · 7 comments · Fixed by #1385
Closed
Assignees
Labels
feature has pr A PR has been created to address this issue in-progress P4 Low-priority issue that needs to be resolved
Projects

Comments

@adamdport
Copy link

Bug Report

What is the expected behavior?

fxLayout shouldn't override display: none, or should provide a way to coexist with other directives/controllers

What is the current behavior?

fxLayout sets display:flex every time the screen changes past a breakpoint regardless of what was previously set.

What are the steps to reproduce?

https://stackblitz.com/edit/angular-flex-layout-seed-cevrf5

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

Directives are often used to hide an element. The current implementation of fxLayout makes that impossible

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

"@angular/core": "7.2.5",
"@angular/flex-layout": "7.0.0-beta.23"
Chrome

Is there anything else we should know?

This wasn't an issue until recently

@CaerusKaru
Copy link
Member

Can you try with beta 24?

@adamdport
Copy link
Author

No difference on beta 24

@CaerusKaru CaerusKaru added bug in-progress P1 Urgent issue that should be resolved before the next re-lease and removed can be closed? labels Apr 10, 2019
@CaerusKaru CaerusKaru added this to Pending in API Fixes via automation Apr 10, 2019
@CaerusKaru CaerusKaru added this to the 8.0.0-beta.25 milestone Apr 10, 2019
@CaerusKaru
Copy link
Member

Ok I see the issue now. That's very frustrating. We'll try and get a fix in as soon as we can.

@jothipandiyanjp
Copy link

Is there any workaround to fix this issue temporarily?

@CaerusKaru
Copy link
Member

I've thought about this quite a bit, and here's where I landed. The library as it's intended to be used means "this library clobbers all styles in the name of simplicity". That's why we use inline styles to begin with; we want users' intentions to override anything else in the markup. I understand your gripe here: you have a use case you believe is common and you think the library should adapt. In a way, you're right. But unfortunately, we can't have everything all the time.

What I have done, is introduce a new opt-in feature that does exactly what you're asking for. The caveat is that it is very hands-off. You need to now manage the display tag yourself, i.e. reset it back to the the right setting when you "un-hide". I hope this is satisfactory for your use case, because this was about the most I was willing to do here. Multi-variable style detection is an enormous undertaking, and for this library to track every style change across all elements that directives sit on, while interesting, is not covered in the current implementation. Perhaps in the new RFC #1185 this can be achieved, and in fact to some degrees that's what it was engineered for, but not in the existing library.

@CaerusKaru CaerusKaru added has pr A PR has been created to address this issue feature P4 Low-priority issue that needs to be resolved and removed bug P1 Urgent issue that should be resolved before the next re-lease labels Jan 3, 2022
@CaerusKaru
Copy link
Member

The PR to close this out is #1385, and should land in the next release.

API Fixes automation moved this from Pending to Done Jan 3, 2022
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Feb 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature has pr A PR has been created to address this issue in-progress P4 Low-priority issue that needs to be resolved
Projects
API Fixes
  
Done
Development

Successfully merging a pull request may close this issue.

3 participants