Skip to content

Tabs title and content broken when using *ngFor #1052

Closed
@rubenlg

Description

@rubenlg

Bug, feature request, or proposal:

Here is a plunker based on the template provided on the root README.md:
http://plnkr.co/edit/CFJy3QkubNIzlm6ZUvzn?p=preview

What is the expected behavior?

Tabs labels are always visible, regardless of whether they are static or dynamic. Content is visible for the current tab.

What is the current behavior?

Only static tab labels are visible (i.e. the last tab) until you click on one of them. No content is visible, not even for the static tab.
If I change the CSS for ".md-tab-body[_ngcontent-nxk-3]" to drop the "display: none" rule from the chrome inspector, then I can see the content for the static tab, but for dynamic tabs I have to click twice to see their content.

What are the steps to reproduce?

http://plnkr.co/edit/CFJy3QkubNIzlm6ZUvzn?p=preview (based on your template)

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

Make tabs work when generated dynamically via ngFor.

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

Not sure, whatever you bundle on your plunker template.

Is there anything else we should know?

Part of the issues are potentially related to #957, although my plunker exposes a few other issues.

Metadata

Metadata

Assignees

Labels

P1Impacts a large percentage of users; if a workaround exists it is partial or overly painful

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions