md-tabs: with position fixed element inside tabs
For example, you have page with tabs, on one tab you have floating fab button at right down corner of the screen.
You can't set position fixed for element in md-tab-content. When I turn off css rule transform (on md-tab-content) element which has position fixed is correctly positioned to the browser viewport.
I think it is related to this behavior https://code.google.com/p/chromium/issues/detail?id=20574 http://stackoverflow.com/questions/2637058/positions-fixed-doesnt-work-when-using-webkit-transform
When child has "position fixed", and parent has "transform" you can't position child to the viewport via css "position: fixed". The child is positioned to the parent.
Tested on Window's Chrome browser and Firefox. Both wrong.
Btw. Is it good idea add fab button into tabs at all? One tab has fab button, another not.
Btw. Is it good idea add fab button into tabs at all? One tab has fab button, another not.
Seems like this is fine. The material design spec has a nice example of using a fab with tabs: http://www.google.com/design/spec/components/buttons-floating-action-button.html#buttons-floating-action-button-behavior
If there is a floating action button on multiple lateral screens (such as on tabs), upon entering each screen, the button should show and hide if the action contained on each is different. If the action is the same, the button should stay on screen (and translate to a new position, if necessary.)
@mckenzielong I mean in code placing fab button into tab's content.
Maybe can put your fab button outside the tabs, but under the same controller, watch for the selectedIndex, and show/hide the button accordingly. I assume your fab button depends on the same controller/directive, since you want it to be inside a tab?
http://material-design.storage.googleapis.com/publish/material_v_3/material_ext_publish/0B6Okdz75tqQsVlhxNGJCNTEzNFU/components-buttons-fab-behavior_04_xhdpi_009.webm
Furthermore, I think that from a responsive design point of view it's better to have the button outside the tabs anyway.
UI primary elements, such as the FAB button, should have positioning, padding and margin settings adjusted to the screen sizes and orientations of the devices, not the layout of the page, which may change drastically from one screen to the other, because of resposive rules. Whereas the user's thumb or index, they stay the same: a finger needs the same contact zone and safe area, whatever the layout, (iWatch) or gigantic (Minority Report).
One last problem, but could be dealt with: your FAB button is going to animate-out along with the tab content when the user navigates from one tab to the other, and it might feel strange seeing a fixed interface element suddenly scroll. And it's going to be swipable too, I guess, since all tab contents are.
From an app point of view, I would make use of the FAB button only for the primary layer in the app actions hierarchy.
You want to use it in a tab, but not the others, I think that goes a bit against the implied rules the the FAB button should be perceived as a "main actions" button by the user, therefore always in sight. The way I see it It's supposed to be a kind of an "actions hub".
What is your rationale behind using a FAB button in a tab? Do use md-tabs as entire pages/screens?
I am also facing the same problem to fix fab always on the screen in md-tab-content ..... but due to its viewport set to that container i am unable to fix its position on the screen. I use fab to create some contents in the tab container but when number of elements increase in the container the fab button goes below the screen and user have to scroll to get it back on screen. Please fix it soon.