Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fxLayout="row" fxLayoutWrap fxLayoutGap="10px" gives an offset starting at the 2nd line #108

Closed
maxime1992 opened this issue Jan 11, 2017 · 10 comments · Fixed by #148
Closed
Labels
bug has pr A PR has been created to address this issue
Milestone

Comments

@maxime1992
Copy link

<div fxLayout="row" fxLayoutWrap fxLayoutGap="10px">
  <div class="card" fxFlex="25%" *ngFor="let i of [1, 2, 3, 4, 5, 6, 7, 8, 9]">
    Test
  </div>
</div>

image

https://plnkr.co/edit/f44sdpW159qKSGvWkWm5?p=preview

(probably) related to #106 except that here the layout is set to row

@joshwiens
Copy link
Contributor

joshwiens commented Jan 11, 2017

@maxime1992 - Different issue than #106. In this case layout-gap.ts is filtering out the first element in the collection which is where the weird offset is coming from.

@joshwiens joshwiens added the bug label Jan 11, 2017
@joshwiens joshwiens added this to the v2.0.0-rc.0 milestone Jan 11, 2017
@joshwiens
Copy link
Contributor

joshwiens commented Jan 11, 2017

@ThomasBurleson - Given the way elements wrap, wouldn't it make more sense to use margin-right in layout-gap.ts for fxLayout="row" and drop the filter on the first element?

You would end up with consistent behavior for both wrap & wrap-reverse

@joshwiens joshwiens self-assigned this Jan 11, 2017
@joshwiens joshwiens added the has pr A PR has been created to address this issue label Jan 11, 2017
@joshwiens
Copy link
Contributor

Resolved with f35c58f

@maxime1992
Copy link
Author

I tried to upgrade from 2.0.0-beta.1 to 2.0.0-beta.4 and the problem is still here on my end.

Take a look to the previous Plunkr : https://plnkr.co/edit/f44sdpW159qKSGvWkWm5?p=preview
I dig into lib/config.js, and I tried to access to
https://unpkg.com/@angular/flex-layout/bundles/flex-layout.umd.js
which redirects me to :
https://unpkg.com/@angular/flex-layout@2.0.0-beta.4/bundles/flex-layout.umd.js

so Plunkr is using the latest version and the gap issue is still here.

I think this issue should be re opened.

@prateek0103
Copy link

prateek0103 commented Jan 30, 2017

@angular/flex-layout: 2.0.0-beta.4

For a quick workaround, I added CSS rule margin-left equal to the fxLayoutGap value to the first element. Check out this plnk

This needs a fix and should be reopened.

@ThomasBurleson
Copy link
Contributor

ThomasBurleson commented Jan 31, 2017

@d3viant0ne - f35c58f does not address issues manifesting when fxLayoutWrap is used.

I suggest the following changes:

  • margin-right be used with fxLayout="row" fxLayoutWrap fxLayoutGap combinations
  • margin-bottom be used with fxLayout="column" fxLayoutWrap fxLayoutGap combinations

ThomasBurleson added a commit that referenced this issue Jan 31, 2017
*  `margin-right` be used with `fxLayout="row" fxLayoutWrap fxLayoutGap` combinations
*  `margin-bottom` be used with `fxLayout="column" fxLayoutWrap fxLayoutGap` combinations

fixes #108
ThomasBurleson added a commit that referenced this issue Feb 3, 2017
*  `margin-right` be used with `fxLayout="row" fxLayoutWrap fxLayoutGap` combinations
*  `margin-bottom` be used with `fxLayout="column" fxLayoutWrap fxLayoutGap` combinations

fixes #108
ThomasBurleson added a commit that referenced this issue Feb 3, 2017
*  `margin-right` be used with `fxLayout="row" fxLayoutWrap fxLayoutGap` combinations
*  `margin-bottom` be used with `fxLayout="column" fxLayoutWrap fxLayoutGap` combinations

fixes #108
ThomasBurleson added a commit that referenced this issue Feb 3, 2017
*  `margin-right` be used with `fxLayout="row" fxLayoutWrap fxLayoutGap` combinations
*  `margin-bottom` be used with `fxLayout="column" fxLayoutWrap fxLayoutGap` combinations

fixes #108
ThomasBurleson added a commit that referenced this issue Feb 7, 2017
*  `margin-right` be used with `fxLayout="row" fxLayoutWrap fxLayoutGap` combinations
*  `margin-bottom` be used with `fxLayout="column" fxLayoutWrap fxLayoutGap` combinations

fixes #108
ThomasBurleson added a commit that referenced this issue Feb 7, 2017
*  `margin-right` be used with `fxLayout="row" fxLayoutWrap fxLayoutGap` combinations
*  `margin-bottom` be used with `fxLayout="column" fxLayoutWrap fxLayoutGap` combinations

fixes #108.
tinayuangao pushed a commit that referenced this issue Feb 8, 2017
…ons (#148)

*  `margin-right` be used with `fxLayout="row" fxLayoutWrap fxLayoutGap` combinations
*  `margin-bottom` be used with `fxLayout="column" fxLayoutWrap fxLayoutGap` combinations

fixes #108.
karlhaas pushed a commit to karlhaas/flex-layout that referenced this issue May 3, 2017
…ons (angular#148)

*  `margin-right` be used with `fxLayout="row" fxLayoutWrap fxLayoutGap` combinations
*  `margin-bottom` be used with `fxLayout="column" fxLayoutWrap fxLayoutGap` combinations

fixes angular#108.
@kousik77
Copy link

how to set margin top and bottom

@spt131
Copy link

spt131 commented May 9, 2018

Any fix for this? Using 2.0 rc1 doesn't resolve.

@tabruzzomufg
Copy link

?? having the same issue? any fixes for this?

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug has pr A PR has been created to address this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants