-
Notifications
You must be signed in to change notification settings - Fork 771
Shouldn't fxFlex value be independent of fxLayoutGap (with fxLayout="row") #235
Comments
I believe your problem is when combining NOTE: This is not a perfect solution since the Gap will be 1% instead of 10px. |
@gabucito that's my point, there is something bothering with the current way these properties work! |
(I know how to workaround it of course : ) |
@mackelito I would expect that too and I asked for it but for some reasons @ThomasBurleson said :
|
Any progression on this? This makes the layout highly unusable. Build a grid of items with proper margins is one of the basic things everyone does. I agree with @mackelito. I would also expect the fxLayoutGap to put gaps in both axis. |
Just ran into this problem, I'm not concerned about the gap below - but certainly the combination of gap + wrap + flex is causing some layout annoyance Without using Gap
With using Gap
Swapping to Align (space-between)
As mentioned above space between is kind of ok for the moment, but I'm sure a more complex issue will arise soon... wish I had the answer but didn't want to just plus 1 on others as I do not feel the gap below is a problem, can just add margin-bottom on your div / card to sort that ourselves fine |
A more complex example is actually pretty easy to dream up. Mostly because I'm running into this issue in my enterprise level web application that my team is building. Take the above example and pretend you actually want to add some cards below that that only take up half of the space.
This becomes a problem when you want a page to use the Flex Layout package but you also want uniformity in how the elements are spaced out on the screen. I shouldn't be doomed to making a decision of either... a.) Having all of the elements on the screen, in my use-case it's a form, be required to have the same number of elements on every line or b.) Having inconsistent inner-spacing between them. |
it is possible to set Gap as px using calc:
cheers! |
@Marcidius the first set of cards leave 2x 5% space per row, and the second set of cards leave 1x 10% space per row. The gap in the second set of cards is much wider, but it's the same as the sum of gaps in the first set of cards. To me that seems to be working as intended. However, what annoys me is that the spacing (or layout gap) doesn't apply for the cross axis. I now too have to use a style margin for bottom. Hopefully there will be a solution to this in the near future. |
Along with #134, we're looking into ways of augmenting |
I've submitted a preliminary PR for this, please see #667. If any of you have comments on that solution, we'd welcome them on that PR. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
The problem I am trying to highlight is the relation between the
fxLayoutGap
and thefxFlex
percentage used withfxLayout="row"
.To me, the
fxFlex
value should a percentage of the available space minus thefxLayoutGap
applied inbetween the elements.So in the following screenshot for example, I would expect to have 2 lines of 4 squares (because 25% is a quarter of 100%):

https://plnkr.co/edit/W6N0q7mSjEjBKGyws3R4?p=preview
The text was updated successfully, but these errors were encountered: