Expected behaviour is that when adding fxFlex et al that style attributes are only applied on those elements where flex has been applied. For example:
<div [formGroup]="form”>
<div fxFlex fxLayout="row" fxLayout.xs="column”>
<div fxFlex="25" fxLayoutAlign="center center" class="logo-wrapper”>
…
</div>
</div>
</div>
The current behaviour is that flex attributes are getting injected into the parent elements, please see below:
Component Template
<h2>Assessment Center Settings</h2>
<div>
<div fxFlex fxLayout="row" fxLayout.xs="column">
XXXX
</div>
</div>
Rendered HTML
<h2 _ngcontent-c19="">Assessment Center Settings</h2>
<div _ngcontent-c19="" style="flex-direction: row; box-sizing: border-box; display: flex;”> <--- why is this getting added??
<div _ngcontent-c19="" fxflex="" fxlayout="row" fxlayout.xs="column" ng-reflect-layout="row" ng-reflect-layout-xs="column" ng-reflect-flex="" style="flex-direction: row; box-sizing: border-box; display: flex; flex: 1 1 0%;"> XXXX </div>
</div>
Providing a StackBlitz (or similar) is the best way to get the team to see your issue.
npm nightly release: Angular v6.0.3
@angular/flex-layout: "^6.0.0-beta.16"
Typescript 2.7.2
OS: macOS
Browsers: Chrome and Safari
The current behavior _is_ the expected behavior, but can be overridden using the static config initializer:
FlexLayoutModule.withConfig({addFlexToParent: false})
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._
Most helpful comment
The current behavior _is_ the expected behavior, but can be overridden using the static config initializer:
FlexLayoutModule.withConfig({addFlexToParent: false})