I am using ngx-tooltip (https://www.npmjs.com/package/ngx-tooltip) with angular.material.io tabs and am running into an issue where the tooltip appears to get cut off on the left side when inside of the md-tab container. How do I make it such that the tooltip floats above everything? Is there some way I can adjust the z-index of the tooltip or is there some other way?
Code:
<md-tab-group>
<md-tab label="Tab 1">
<!-- tooltip with dynamic html content -->
<div>
<tooltip-content #myTooltip>
<b>Very</b> <span style="color: #C21F39">Dynamic</span> <span style="color: #00b3ee">Reusable</span>
<b><i><span style="color: #ffc520">Tooltip With</span></i></b> <small>Html support</small>.
</tooltip-content>
<button [tooltip]="myTooltip">hover this button to see a tooltip</button>
</div>
</md-tab>
</md-tab-group>
I reproduced your problem in this plunker. In order to make the tooltip visible outside of the md-tab container, I had to do the following (see this corrected plunker):
ViewEncapsulation.None
:import {ViewEncapsulation} from '@angular/core';
@Component({
...
styleUrls: ["./tabs-overview-example.css"],
encapsulation: ViewEncapsulation.None
})
overflow
attribute as follows:md-tab-group,
md-tab-body,
.mat-tab-body-wrapper,
.mat-tab-body-content
{
overflow: visible !important;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With