Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tooltip arrows misaligned if ViewEncapsulation.None is set globally. #1875

Closed
bfbares opened this issue Sep 28, 2017 · 2 comments
Closed

Tooltip arrows misaligned if ViewEncapsulation.None is set globally. #1875

bfbares opened this issue Sep 28, 2017 · 2 comments

Comments

@bfbares
Copy link

bfbares commented Sep 28, 2017

Bug description:

Tooltip arrows misaligned if ViewEncapsulation.None is set globally.

Link to minimally-working plunker that reproduces the issue:

http://plnkr.co/edit/cAtUk1W8m9emOlZHBkwZ?p=preview

Version of Angular, ng-bootstrap, and Bootstrap:

Angular: 4.0.3

ng-bootstrap: 1.0.0-beta.5

Bootstrap: 4.0.0-beta

@mschoudry
Copy link
Contributor

Hi,
Component level styles are used in ngbootstrap by some components(tooltip, popover, datepicker, timepicker), therefore ngbootsrap is dependent on default ViewEncapsulation i.e. Emulated, to work properly. If ViewEncapsulation is changed then these components will not work properly.

encapsulation can be applied at each component level of ngbootstrap to avoid such issue, so that it should not have any impact from the parent ViewEncapsulation.

@pkozlowski-opensource @maxokorokov comments please?

Regards,

@Adondriel
Copy link

Adondriel commented Dec 28, 2017

In the plunkr, I messed around with the class.

.tooltip.bs-tooltip-auto[x-placement^=top] .arrow::before, .tooltip.bs-tooltip-top .arrow::before {
    /* margin-left: -3px; */
    content: "";
    border-width: 5px 5px 0;
    border-top-color: #000;
}

Fixes it, but this also creates an issue with the border-radius on the actual tooltip itself, so you also have to fix that, using this CSS:

.tooltip-inner {
    max-width: 200px;
    padding: 3px 8px;
    color: #fff;
    text-align: center;
    background-color: #000;
    /* border-radius: .25rem; */

This produces:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants