Skip to content

Commit

Permalink
fix(tooltip): properly position tooltips close to container edges
Browse files Browse the repository at this point in the history
Fixes #1263
Fixes #1371
Closes #1643
  • Loading branch information
mschoudry authored and pkozlowski-opensource committed Jun 30, 2017
1 parent 5d79c00 commit 4a221c1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/tooltip/tooltip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,11 @@ export class NgbTooltip implements OnInit, OnDestroy {
window.document.querySelector(this.container).appendChild(this._windowRef.location.nativeElement);
}

// position tooltip along the element
positionElements(
this._elementRef.nativeElement, this._windowRef.location.nativeElement, this.placement,
this.container === 'body');

// we need to manually invoke change detection since events registered via
// Renderer::listen() - to be determined if this is a bug in the Angular itself
this._windowRef.changeDetectorRef.markForCheck();
Expand Down

0 comments on commit 4a221c1

Please sign in to comment.