flex-layout icon indicating copy to clipboard operation
flex-layout copied to clipboard

Applying flex to parent which is an app has unexpected results

Open hags033 opened this issue 8 years ago • 5 comments

Bug Report

What is the expected behavior?

The app-* tags shouldn't have any styles applied to them

What is the current behavior?

Flex applies styles to the parent, including app-* tags as of the latest release

What are the steps to reproduce?

Have the first div inside your component.html apply an fxFlex directive.

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

Applying flex to parents are fine, as long as they aren't app-* tags.

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

This should be the same across all versions

Is there anything else we should know?

This seemed to be changed awhile back to not automatically apply this, and then now re-appeared with the latest release.

hags033 avatar Jun 11 '18 17:06 hags033

See https://github.com/angular/flex-layout/blob/master/CHANGELOG.md#breaking-changes and https://github.com/angular/flex-layout/wiki/Configuration

CaerusKaru avatar Jun 11 '18 18:06 CaerusKaru

I understand that, but why would it be an all or nothing thing? Applying the flex properties to parents have positive results, but again, they should NOT be applied to <app-*> parents.

hags033 avatar Jun 11 '18 18:06 hags033

The prefix is not always app, and it should not be up to the Flex Layout library to selectively determine which prefixes to ignore. This gets even more complicated when you factor in the rise of Custom Elements on the web. You are welcome to propose an agnostic change if you can come up with a reasonable implementation.

CaerusKaru avatar Jun 11 '18 18:06 CaerusKaru

We have went down the route of applying addFlexToParent: false, but now AOT doesn't build throwing the error: Function calls are not supported in decorators but ‘FlexLayoutModule’ was called.

hags033 avatar Jun 12 '18 19:06 hags033

If you have a separate issue, please open a separate issue, with a minimal reproduction.

CaerusKaru avatar Jun 12 '18 20:06 CaerusKaru