material icon indicating copy to clipboard operation
material copied to clipboard

md-fab-top-right md-bottom-right: Position not fixed with md-content within md-tabs

Open dgavigan opened this issue 11 years ago • 5 comments

The classes used to fix fabs buttons to the top or bottom becomes broken inside a md-tab containing the md-content directive

screen shot 2015-08-05 at 2 10 01 pm

http://codepen.io/dgavigan/pen/KpJXNw

dgavigan avatar Aug 05 '15 19:08 dgavigan

I think I understand the problem, but I have a quick question: what is your expectation of where the FAB will appear?

Do you expect it to:

  1. appear at the bottom right of the content after scrolling it into view
  2. or appear outside of the tabs at the bottom right of the screen

topherfangio avatar Aug 05 '15 19:08 topherfangio

I expect it to stay in view on the bottom right within each tab.

My example use case is that I have scrolling content on multiple tabs, and trying to use a fab in the lower right for actions specific to current tab. In this case, uploading a photo.

So I guess 2. But I only want it to be visible on a specific tab. Not for every tab.

screen shot 2015-08-05 at 3 14 48 pm

screen shot 2015-08-05 at 3 14 51 pm

dgavigan avatar Aug 05 '15 19:08 dgavigan

Based on the FAB style recommendations (check the "For tabbed screens..." paragraph under Behavior), I would recommend an approach similar to this: http://codepen.io/topherfangio/pen/vObeQb

This way, each FAB is shown/hidden based on what tab is selected, but they aren't inside the tabs. This is important because it means that they won't "slide" with the tab's animation.

topherfangio avatar Aug 05 '15 20:08 topherfangio

@topherfangio you da man! thanks for the help. your fab wizardy strikes again.

dgavigan avatar Aug 05 '15 20:08 dgavigan

@dg1202 Glad to help! ;-)

topherfangio avatar Aug 05 '15 20:08 topherfangio