Skip to content
This repository was archived by the owner on Jan 6, 2025. It is now read-only.
This repository was archived by the owner on Jan 6, 2025. It is now read-only.

Combination of fxLayoutWrap fxLayoutGap modification #165

@Jonatthu

Description

@Jonatthu
<div class="first" fxFlex="100%" fxFlex.xs="auto" fxLayout="row" fxLayoutWrap fxLayoutGap="20px">
        <div class="title" fxFlex="100%"><b>Contact Information</b></div>
        <div class="item" fxFlex="25%" *ngFor="let i in [1,2,3,4,5,6]">
          <b>Phone</b> <br>
          {{listing.contact.phoneNumber}}
        </div>
</div>

Ok I'm using beta 4 and I've seen beta 5 milestones but i'm not seeing something to my question.
Right now this code above is generating the items with margin-left 20px all of them but is not doing groups of 4 as I intended with 25% (1/4 of the container per item).

Intead apply margin-left of 20px I would recommend to apply padding-left of 20px and the parent layout
have margin-left of -20px (margin-left: -20px) so the list is align for every group of 100% insert a div parent for example:

<div class="first" fxFlex="100%" fxFlex.xs="auto" fxLayout="row" fxLayoutWrap fxLayoutGap="20px">
        <div class="title" fxFlex="100%"><b>Contact Information</b></div>
        <!-- Insert for every group of 100% or almost 100% by example if in 5 elements are 75% and the next item is 40% is 115% so just insert the parent div in the 75% and the other 40% item put it in another parent of 100%--->
        <div class="auto-inserted-parent-by-flex" style="margin-left:-20px">
              <div class="item" fxFlex="25%" *ngFor="let i in [1,2,3,4,5,6]">
              <b>Phone</b> <br>
              {{listing.contact.phoneNumber}}
             </div>
        </div>
</div>

Insert for every group of 100% or almost 100% by example if in 5 elements are 75% and the next item is 40% is 115% so just insert the parent div in the 75% and the other 40% item put it in another parent of 100%

fx

For each parent is a width of calc(100% + 20px)
My picture seems like the items are separated but they are not

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions