question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[docs] fxLayoutGap not usable in combination with wrap and breakpoints

See original GitHub issue

Bug, feature request, or proposal:

It would be nice if fxLayoutGap could be improved (or an alternative could be made) to make it work in combination with flexLayout=“row wrap” without custom CSS.

What is the expected behavior?

Each line fill the complete width.

What is the current behavior?

The layout gap at the end of the line is not accounted for. Each diff except the last one has an offset on the right.

What are the steps to reproduce?

Providing a StackBlitz (or similar) is the best way to get the team to see your issue.

https://stackblitz.com/edit/flexlayoutgap-breakpoints

What is the use-case or motivation for changing an existing behavior?

I know about the fxFlex=“calc(100% - gap px)” workaround but writing this for each element and each breakpoint is a lot of work.

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Angular 6.0.x @angular/flex-layout 6.0.0-beta.15

Is there anything else we should know?

I used the following scss as an alternative to fxLayoutGap:

$md-layout-gap: 24px;

[fxLayout].md-layout-gap {
    margin-right: (-$md-layout-gap) !important;

    [fxFlex] {
        margin-right: $md-layout-gap !important;
    }
}

I am sure this can be done a lot nicer if this was implemented in flexLayout (no !important, layoutGap as a property)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:8
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

29reactions
CaerusKarucommented, May 30, 2018

Did you try using fxLayoutGap in grid mode?

E.g. fxLayoutGap=“10px grid”

13reactions
ghostcommented, Jul 26, 2018

Please add the “grid-mode” behavior to the documentation since it’s an essential feature! Thx 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular flex-layout - fxLayoutGap causes annoying gap at end ...
For anyone looking for the answer to this problem, you need to add grid to fxLayoutGap. The documentation at ...
Read more >
Getting started with Angular Flex-Layout - Excellarate
In this post, I will show how to use Angular Flex-Layout in HTML. Angular layout provides a sophisticated API using Flexbox.
Read more >
Angular flex layout basics
fxLayoutGap is a directive that defines the gap between the children items within a flexbox container. <div fxLayoutGap="5px"></div>. fxLayoutAlign.
Read more >
How To Use Flex Layout for Angular - DigitalOcean
This code will set breakpoints at xs (extra small) screen sizes. It will change the layout from the default "row" to "column" and...
Read more >
Create a responsive card grid in Angular using Flex Layout
<div fxLayout="row wrap" fxLayoutGap="16px grid"> . ... control what to show and what not to, at different breakpoints according to our UI/UX preferences....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found