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).
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._
Most helpful comment
Definitely an oversight. We will fix. Thx