Open gpopovic opened 9 years ago
I would agree that md-dynamic-height attribute adds some excellent functionality. However I would like an attribute called: md-layout-fill. Which would instruct md-tabs to fill the entire layout it is in.
The problem I am having is that my tab content is loaded through an ng-include. This sometimes has a delay and if md-dynamic-height calculates before the content is there you'll be looking at nothing or some chopped off content.
Is there another way to instruct md-tabs how to tall it should be in 0.9?
@ACDN I believe this would be accomplished with our layout
API.
@gpopovic Not a bad idea, should be fairly easy to implement since the math and logic are already there.
+1
+1
+1
+1
+1
@robertmesserle As far as I can tell, it is impossible to use the layout API to accomplish vertically stretched tabs.
See this plunkr: http://plnkr.co/edit/V08Ler8vaZGPaRaurtf9?p=preview
The layout attributes applied cause the tabs control to stretch vertically, and should cause the tabs' content to stretch to fill their parent as well, but this is not what happens.
+1 There doesn't seem to be any way to get the content of a tab to fill the available space with any combination of layout and flex attributes.
+1
+1
Worked with previous versions: http://plnkr.co/edit/V08Ler8vaZGPaRaurtf9?p=preview
+1
:+1:
+1
+1
+1
+1
+1
good grief .. April 2015 ?
Surely we should have had a solution by now. I've spent hours trying to make this work before coming across this issue
@jmls i also spend hours and hours :)
hope it gets fixed soon
I ended up writing some custom css to target the hidden div compiled by the directive. It revolves around applying the styles of the layout-fill class to the hidden div.
It works for my use case, it might help others as well.
+1
@ThomasBurleson why did you close it? We still can't set a specific height for md-tabs...
+1
+1
@here - we will welcome Pull Request with this enhancement/fix. And we can reopen this issue at that time. Meanwhile, the core team will not work on this.
This issue is closed as part of our ‘Surge Focus on Material 2' efforts. For details, see our forum posting.
See a (somewhat hacky) solution here: http://stackoverflow.com/questions/30314441/angularjs-material-tab-height-issue/37856853#37856853
I noticed that manually switching to another tab and then switching back to the previous tab did solve the issue, so I went for that really ugly hack:
$timeout(function(){
ctrl.selectedTab = 1;
$timeout(function(){
ctrl.selectedTab = x; // x being the number of the tab you want to reset
});
});
<md-tabs md-dynamic-height md-selected="ctrl.selectedTab">
It does the trick...
@ThomasBurleson I added a md-stretch-height option to fill available space of md-tabs parent element.
+1
Currently waiting for review feedback to be addressed in the PR.
@Splaktar You're currently waiting for yourself.
Currently md-tabs offer md-dynamic-height ability which can be nice but ...
Is it possible to somehow force md-tabs to set height to a height of the highest tab ?