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

fix(style): apply correct flex with ngStyle and layout change #733

Closed
wants to merge 1 commit into from

Conversation

Teamop
Copy link
Contributor

@Teamop Teamop commented May 7, 2018

Fix #700
For this issue, I found that the flex is initialized to '1 1 0%', when the layout changes, the layout event triggers before ngStyle, so invokes _updateStyle to apply this initialization to the ngStyleBase. Then for the following ngStyle.lt-md event, just merge this base style.

So the change is: when the input changes in the StyleDirective, check the base style, if it's not same with the current style, replace it with the current style and for others which have been merged with ngStyleBase, delete the corresponding style and merge again.

In the following test cases, the first case is just like the scenario in the #700

@Teamop
Copy link
Contributor Author

Teamop commented May 7, 2018

Failure in SSR: 1) style directive should allow more than one responsive breakpoint on one element

@Teamop Teamop closed this May 7, 2018
CaerusKaru added a commit that referenced this pull request Jun 11, 2018
* fix(fxFlex): do not eagerly listen to layout changes

* currently, `fxFlex` listens for container events (e.g. `fxLayout`)
  in the constructor. Unfortunately, this is too eager and sometimes
  takes place before the `fxFlex` value is actually set

Fixes #700
PR Close #733
@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 Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fxFlex is not work well with NgStyle.lt-md and layout change
2 participants