Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions src/material/grid-list/grid-list.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,14 @@ describe('MatGridList', () => {
expect(footer.nativeElement.classList.contains('mat-2-line')).toBe(true);
});

it('should add class to footers with two indirect descendant lines', () => {
const fixture = createComponent(GridListWithFooterContainingTwoIndirectDescendantLines);
fixture.detectChanges();

const footer = fixture.debugElement.query(By.directive(MatGridTileText))!;
expect(footer.nativeElement.classList).toContain('mat-2-line');
});

it('should not use calc() that evaluates to 0', () => {
const fixture = createComponent(GirdListWithRowHeightRatio);

Expand Down Expand Up @@ -784,6 +792,19 @@ class GridListWithFootersWithoutLines { }
</mat-grid-list>`})
class GridListWithFooterContainingTwoLines { }

@Component({template: `
<mat-grid-list cols="1">
<mat-grid-tile>
<mat-grid-tile-footer>
<ng-container [ngSwitch]="true">
<h3 mat-line>First line</h3>
<span mat-line>Second line</span>
</ng-container>
</mat-grid-tile-footer>
</mat-grid-tile>
</mat-grid-list>`})
class GridListWithFooterContainingTwoIndirectDescendantLines { }

@Component({template: `
<mat-grid-list cols="5">
<mat-grid-tile [rowspan]="1" [colspan]="3">1</mat-grid-tile>
Expand Down
2 changes: 1 addition & 1 deletion src/material/grid-list/grid-tile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export class MatGridTile {
encapsulation: ViewEncapsulation.None,
})
export class MatGridTileText implements AfterContentInit {
@ContentChildren(MatLine) _lines: QueryList<MatLine>;
@ContentChildren(MatLine, {descendants: true}) _lines: QueryList<MatLine>;

constructor(private _element: ElementRef<HTMLElement>) {}

Expand Down