Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

fix(tooltip): incorrect position when text wraps #2996

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions src/tooltip/tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,14 +189,7 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position', 'ui.bootstrap

// Set the initial positioning.
tooltip.css({ top: 0, left: 0, display: 'block' });

// Now we add it to the DOM because need some info about it. But it's not
// visible yet anyway.
if ( appendToBody ) {
$document.find( 'body' ).append( tooltip );
} else {
element.after( tooltip );
}
ttScope.$digest();

positionTooltip();

Expand Down Expand Up @@ -236,7 +229,13 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position', 'ui.bootstrap
removeTooltip();
}
tooltipLinkedScope = ttScope.$new();
tooltip = tooltipLinker(tooltipLinkedScope, angular.noop);
tooltip = tooltipLinker(tooltipLinkedScope, function (tooltip) {
if ( appendToBody ) {
$document.find( 'body' ).append( tooltip );
} else {
element.after( tooltip );
}
});
}

function removeTooltip() {
Expand Down