This repository has been archived by the owner on Jan 6, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 772
fxFlex is not work well with NgStyle.lt-md and layout change #700
Labels
Milestone
Comments
Teamop
changed the title
fxFlex is not work well with NgStyle.lt-md
fxFlex is not work well with NgStyle.lt-md and layout change
Apr 6, 2018
CaerusKaru
added
bug
flexbox
P0
Critical issue that needs to be resolved immediately
labels
Apr 6, 2018
This is definitely an issue, and a puzzling one. As you pointed out, this is caused by how our wrapper for the NgStyle directive is merging styles. At some point, the default |
@CaerusKaru Currently, I just use CSS flex to replace fxFlex as a workaround |
Teamop
added a commit
to Teamop/flex-layout
that referenced
this issue
May 7, 2018
Teamop
added a commit
to Teamop/flex-layout
that referenced
this issue
May 7, 2018
CaerusKaru
added a commit
that referenced
this issue
Jun 11, 2018
* 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
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Bug, feature request, or proposal:
Set fxFlex="5 1 auto" with [ngStyle.lt-md]="{'width.px': 90}", but in the final html, got style:
flex: 1 1 0%
What is the expected behavior?
the flex should be the same in the html
What is the current behavior?
got style:
flex: 1 1 0%
What are the steps to reproduce?
Providing a StackBlitz (or similar) is the best way to get the team to see your issue.
https://stackblitz.com/edit/angular-material-flex-layout-seed-76pec8, check the checkbox, then inspect the displayed span item next to it(items selected)
npm
nightly release:What is the use-case or motivation for changing an existing behavior?
the unexpected style change
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Angular 5.2.9
Angular material 5.2.4
Typescript 2.6.2
Is there anything else we should know?
After some research, checking the checkbox triggers the layout change, so _onLayoutChange() is invoked in flex , then set
ngStyle
toflex: 1 1 0%
, then forNgStyle.lt-md
, the codestyles = extendObject({}, this._base.inputMap['ngStyle'], styles);
(https://github.com/angular/flex-layout/blob/master/src/lib/extended/style/style.ts#L179) merges this style to override the original styleThe text was updated successfully, but these errors were encountered: