Unable to use dynamic tab size for tabs component - Uncaught TypeError: Cannot read property 'elementRef' of undefinedMdTabHeader
I am trying to use the property dynamicHeight for the tabs component as follows : <md-tab-group dynamicHeight [(selectedIndex)]="activeTabIndex"> as explained in the demo at here https://github.com/angular/material2/blob/master/src/demo-app/tabs/tabs-demo.html
Everything else works fine but as soon as I add the variable dynamicHeight to the md-tab-group selector and run it I get an error saying material.umd.js:12277 Uncaught TypeError: Cannot read property 'elementRef' of undefinedMdTabHeader._alignInkBarToSelectedTab @ material.umd.js:12277(anonymous function) @ material.umd.js:12065ZoneDelegate.invokeTask @ zone.js:265Zone.runTask @ zone.js:154ZoneTask.invoke @ zone.js:335data.args.(anonymous function) @ zone.js:970.
What can be done here?
I don't get an error when running it locally. Can you post an example of it happening? You can use this as a template: http://plnkr.co/edit/o077B6uEiiIgkC0S06dd
Thank you @crisbeto. I tried with the template you provided in the same way that I've done it locally. It's here : http://plnkr.co/edit/r9ZoENWacBX6uLfcX7oz?p=preview It's working here but the same when I do on my local I am getting the error. I cannot understand why this is happening.
It might be caused by something that we fixed, but haven't released yet. You can try the latest changes from master by running:
npm install https://github.com/angular/material2-builds.git
It's working fine with this version: https://github.com/angular/material2-builds.git Thanks a lot for the help. It really bugs me though that I cannot find the reason why the version I was perviously using wasn't working for dynamic height.
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.