Inactive tabs are removed from DOM since rc4. Persistent flag possible?
Commit https://github.com/angular/material/commit/8dcaea8af19a6dcc2d9cafdd2ebb4277e66e89ae for 0.10rc4 introduced a new behavior for tabs that removes inactive tab pages from the dom using a ng-if.
In my use case I have Google Maps on one tab and some detail info on a second tab. In this scenario, the commit has the effect that the map (along with everything else that is on the tab) is removed from the DOM and has to be recreated each time the user switches back and forth.
While I realize that removing invisible elements from the DOM can be beneficial for memory & performance reasons this might not be the case for complex elements such as a preinitialized map that has a certain state. In my situation I can restore the map with the information on it but I don't keep track of the user's current viewport (selected element , zoom, etc.).
What do you think of the concept of "persistent" vs. "transient" tabs? That way you could control whether certain tabs can be destroyed while some remain in memory.
I have a use case where I use an ng-include to render partials into the tab's content, and it does some odd flashing when I switch between tabs because it has to be re-rendered each time.
Edit: My issue might be related to the md-dynamic-height transition, actually. When switching tabs, I have a custom directive with a variety of ng-includes that pulls in a template based upon what I pass into the directive. The directive has a height of 0 initially, so when the tab switch occurs the tab transitions to 0 height, then after the transition to the new tab is complete it resized to fit the content, post-transition, thus the odd behavior.
+1
This should be closed now, as this is now opt-in behavior.