material icon indicating copy to clipboard operation
material copied to clipboard

More value in tab results in hiding of a tab - Due to addition of a CSS component

Open vishalsrini opened this issue 10 years ago • 4 comments

Actual Behavior:

  • What is the issue? * Tabs are not working properly once i added the following css property

md-tabs > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-active, md-tabs > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-active md-icon, md-tabs.md-accent > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-active md-icon, md-tabs.md-default-theme.md-accent > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-focused, md-tabs.md-default-theme.md-accent > md-tabs-wrapper > md-tabs-canvas > md-pagination-wrapper > md-tab-item:not([disabled]).md-focused md-icon { color: #3d3d3d !important; font-weight: bold !important; }

  • What is the expected behavior? Want to change the color of text inside those items

CodePen (or steps to reproduce the issue): *

  • CodePen Demo: Click here for codepen demo
  • Details: Click on "Add rule" then copy and paste this rule name "Contract Addition2" you can see the following result

image

Once you remove that you can see how perfectly it works

image

Angular Versions: *

  • Angular Version: 1.5.5
  • Angular Material Version:1.1.0

Additional Information:

  • Browser Type: * node
  • Browser Version: * 1.7.9
  • OS: * windows

vishalsrini avatar Aug 02 '16 11:08 vishalsrini

I can't reproduce the issue with your codepen. Can you recheck please?

devversion avatar Aug 02 '16 22:08 devversion

sorry @DevVersion. I deleted that CSS yesterday in order to show the correct version. Now you can see the issue in the same codepen. I added that CSS part. Click here to view Codepen demo

vishalsrini avatar Aug 03 '16 04:08 vishalsrini

I simplified your selector (it was way to big to investigate).

http://codepen.io/DevVersion/pen/dXqgEj

The problem with your selector is, that the md-tabs directive creates a dummy wrapper, which holds invisible tabs to calculate the width for pagination etc.

Since you changed the font-weight for example, the real tabs are deviating from the dummy tabs, which means that the width of the tab is too small.

To fix the wrong calculation you have to apply the selector to the dummy tabs as well.

http://codepen.io/DevVersion/pen/EyZOYb

devversion avatar Aug 03 '16 10:08 devversion

Thanks @DevVersion. It is working fine.

vishalsrini avatar Aug 03 '16 13:08 vishalsrini