Flex-layout: fxLayoutGap not applied to children inserted after initial render

Created on 6 Jan 2017  路  4Comments  路  Source: angular/flex-layout

Plunk.

When a container with a layout gap has a child that isn't present initially (e.g. has an ngIf condition that evaluates to false), the gap is not applied to the child when it is subsequently inserted.

Worth noting: layoutAlign is working as expected (presumably because alignment is implemented via a rule on the parent whereas gaps are implemented as margins on the children, which isn't happening for children added after the initial layout computation).

bug has pr needs presubmit

Most helpful comment

Definitely an oversight. We will fix. Thx

All 4 comments

Definitely an oversight. We will fix. Thx

@drew-moore - this issue is non-trivial to solve since the @ContentChildren does not support the * selector to match all content-children. Currently the developer must know the Type or the template variable ref name... neither of which is practical for our needs.

The only other current option is to watch with a MutationObserver.

This is a known issue in Angular: https://github.com/angular/angular/issues/9989

@pkozlowski-opensource - any thoughts

@drew-moore - see pending Pull Request #124

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._

Was this page helpful?
0 / 5 - 0 ratings