From dfc736e7a0d793a01156519701e1c0e738696f56 Mon Sep 17 00:00:00 2001 From: Oleksii Aleksandrov Date: Fri, 1 Sep 2017 17:11:19 +0300 Subject: [PATCH] fix(tooltip): fix width property in chrome for custom element (#2559) - fixed width calculation in chrome for bs-tooltip-container(added display: block) - changed test for 'auto' placement, changed 'left' class to 'right' --- src/spec/ng-bootstrap/tooltip.spec.ts | 2 +- src/tooltip/tooltip-container.component.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/spec/ng-bootstrap/tooltip.spec.ts b/src/spec/ng-bootstrap/tooltip.spec.ts index 6c66def28c..9ad480d34b 100644 --- a/src/spec/ng-bootstrap/tooltip.spec.ts +++ b/src/spec/ng-bootstrap/tooltip.spec.ts @@ -198,7 +198,7 @@ describe('tooltip', () => { expect(windowEl).toHaveCssClass('tooltip'); expect(windowEl).toHaveCssClass('tooltip-auto'); - expect(windowEl).toHaveCssClass('left'); + expect(windowEl).toHaveCssClass('right'); expect(windowEl.textContent.trim()).toBe('Great tip!'); }); }); diff --git a/src/tooltip/tooltip-container.component.ts b/src/tooltip/tooltip-container.component.ts index e962b0b0c7..7a2aabc234 100644 --- a/src/tooltip/tooltip-container.component.ts +++ b/src/tooltip/tooltip-container.component.ts @@ -13,7 +13,10 @@ import { isBs3 } from '../utils/ng2-bootstrap-config'; '[class.show]': '!isBs3', role: 'tooltip' }, - styles: [` + styles: [` + :host.tooltip { + display: block; + } :host.bs-tooltip-top .arrow, :host.bs-tooltip-bottom .arrow { left: calc(50% - 2.5px); }