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.

Grid list is not responsive ?

See original GitHub issue

Bug, feature request, or proposal:

Hi guys. I’m trying to have a collection of cards (on multiple line). So I thought that using a Grid list would do the job. So I’ve used a grid list with 4 columns. I have something like 22 cards… But When I’m trying to resize the browser to see the “responsive” side effect, What I see is that cards are just shrinked … I thought that the number of columns will be reduced until to have just one column.

What is the expected behavior?

When reducing the browser, cards should not be shrinked and should be moved below, on the next row, keeping its size.

What is the current behavior?

Cards are shrinked and contents inside the cards disappear.

What are the steps to reproduce?

my-main-component.html

<md-grid-list cols="4">
  <md-grid-tile *ngFor="let reading of data.value"><rbwc-measurement-card [data]="reading" class="card-border"></rbwc-measurement-card></md-grid-tile>
</md-grid-list>

my-rbwc-measurement-card-component.html:

<md-card class="measurement-card" [style]="setCardAlarmStyle()">
  <md-card-header>
    <div md-card-avatar class="measurement-header-image" [style]=setMeasurementAvatar(data.name)></div>
    <md-card-title class="measurement-bold title-layout">{{data.name}}</md-card-title>
  </md-card-header>
  <md-card-content>
    <div> <span class="measurement-bold">Reading:</span> <span [style]="readingFont()">{{data.reading.value}} {{data.reading.units}}</span></div>
    <div *ngIf="data.trend"><span class="measurement-bold">Trend:</span> <span [style]="trendFont()">{{data.trend.value}} {{data.trend.units}}</span></div>
    <form>
      <fieldset *ngIf="data.limits" class="groupBox-border">
        <legend class="groupBox-text-size">Limits:</legend>
        <div *ngFor="let limit of data.limits">{{limit.name}}: <md-form-field floatPlaceholder="never" [style.width.px]="70"><input mdInput [disabled]="disableEdit()" placeholder="{{limit.name}}" type="number" value="{{limit.value}}"><md-icon [ngClass]="{'md-dark md-inactive': disableEdit()}" mdSuffix>mode_edit</md-icon></md-form-field> <span *ngIf="limit.name != limitsNames.TrendLimit">{{limit.units}}</span> <rbwc-trend-limit-units-options *ngIf="limit.name == limitsNames.TrendLimit" [trendReading]="limit"></rbwc-trend-limit-units-options></div>
      </fieldset>
    </form>
  </md-card-content>
  <md-card-actions>
    <button md-button>LIKE</button>
    <button md-button>SHARE</button>
  </md-card-actions>
</md-card>

Am I missing something or doing something wrong ? Thank you in advance for your help

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

Angular: 4.4.0-RC.0 Material: 2.0.0-beta.10 Typescript: 2.5.2 Browser: Chrome (for now)

Multiple cards look before resizing the browser: image

Multiple cards look after resizing the browser: image

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

6reactions
TitaneBoycommented, Sep 19, 2017

@leocaseiro : Thank you for your references… In #6777 , I could find a comment that talk about an responsive angular article that just saved my life. That was what I needed.

Thanks again

1reaction
PurpleEdge2214commented, Jun 19, 2018

It would be good if the Angular Material website made some mention of responsive layout!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular 5 Mat-grid list responsive - Stack Overflow
You have to set the cols attribute of the mat-grid-list dynamically depending on the screen width. You'd have to decide on which width ......
Read more >
Angular Material Responsive Grid - eduCBA
Definition of Angular Material Responsive Grid. In Angular material, we have a grid layout that is used to create the two-dimensional list view....
Read more >
Angular Material Grid Layout Responsive
Material Grid List is so handy to use and makes layouts excellent for use. However it's not responsive. Making it responsive was something...
Read more >
Grid list | Angular Material
mat-grid-list is a two-dimensional list view that arranges cells into ... If rowHeight is not specified, it defaults to a 1:1 ratio of...
Read more >
Turn a collection list into a responsive grid - Webflow University
Grid 2.0 makes it easy to turn content-driven lists like CMS collections, ecommerce product lists, and search result pages into responsive grids. And...
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