Skip to content

proposal(tab): component inside md-tab but outside mat-tab-body-content #4135

Closed
@jefersonestevo

Description

@jefersonestevo

Bug, feature request, or proposal:

proposal?

What is the expected behavior?

Create an area to put some content inside the md-tab but outside the mat-tab-body-content

What is the current behavior?

Everything you put inside a md-tab will be inside the mat-tab-body-content and cannot have a fixed position

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

I have a scenario with a page that uses tabs to show many "subpages". In this scenario, I need to show a content that is contextual to the selected tab but needs to have a fixed position on the page. If I set position: fixed to this element, as the mat-tab-body-content has a transform: translate3d(0px, 0px, 0px), the component looses it's "fixed" behaviour.

If you look at this Plunker and scroll down the page, you'll see that the "fixed" content inside the tab is scrolled within it.

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

2.0.0-beta-3

Is there anything else we should know?

For now, the way I found to solve this is to create the component outside the tab, and render it based on the selectedIndex of the md-tab-group, but I think this solution is really poor as my parent component needs to know the behaviour of my internal component and if someone change my tabs (let's say create a new tab on the beginning) all of my tab indexes will change.

I don't know if the explanation above was really clear but if you have some doubt just ask me.

Metadata

Metadata

Assignees

Labels

featureThis issue represents a new feature or feature request rather than a bug or bug fixneeds: discussionFurther discussion with the team is needed before proceeding

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions