proposal(tab): component inside md-tab but outside mat-tab-body-content
See original GitHub issueBug, 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.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:6 (2 by maintainers)
Top GitHub Comments
https://material.angular.io/components/tabs/examples the lowest example
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.