Skip to content

SortHeader indicator in an inactive MatTab seems broken #8856

@lacolaco

Description

@lacolaco

Bug, feature request, or proposal:

Bug

What is the expected behavior?

MatSort works well in MatTab.

What is the current behavior?

Broken

image

What are the steps to reproduce?

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

Plunker starter (using on @master): https://goo.gl/uDmqyY

StackBlitz starter (using latest npm release): https://goo.gl/wwnhMV

https://stackblitz.com/edit/angular-eaadrn?file=app%2Fsort-overview-example.html

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

I want to put multiple tables in tabs. And they have to accept sort input from its parent.

<mat-tab-group>
	<mat-tab label="Table 1">
		<table-cmp [sort]="{id: 'name', start: 'desc'}"></table-cmp>
	</mat-tab>
	<mat-tab label="Table 2">
		<table-cmp [sort]="{id: 'calories', start: 'asc'}"></table-cmp>
	</mat-tab>
</mat-tab-group>

I tried to pass inputted sort property to MatSort#sort. Initial active tab's table is ok, but inactive tab's tables aren't.

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

Angular 5.0
Material 5.0

Is there anything else we should know?

#8396 may be related.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions