This repository has been archived by the owner on May 29, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(tooltip): correct flash of reposition
- Avoid position computation when tooltip is empty - Force visibility to none when resetting style Closes #4363 Fixes #4195
- Loading branch information
Showing
1 changed file
with
4 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -110,6 +110,7 @@ angular.module('ui.bootstrap.tooltip', ['ui.bootstrap.position']) | |
'animation="animation" '+ | ||
'is-open="isOpen"'+ | ||
'origin-scope="origScope" '+ | ||
'style="visibility: hidden"'+ | ||
'>'+ | ||
'</div>'; | ||
|
||
|
@@ -132,12 +133,13 @@ angular.module('ui.bootstrap.tooltip', ['ui.bootstrap.position']) | |
var isOpenExp = angular.isDefined(attrs[prefix + 'IsOpen']) ? $parse(attrs[prefix + 'IsOpen']) : false; | ||
|
||
var positionTooltip = function() { | ||
if (!tooltip) { return; } | ||
// check if tooltip exists and is not empty | ||
if (!tooltip || !tooltip.html()) { return; } | ||
|
||
if (!positionTimeout) { | ||
positionTimeout = $timeout(function() { | ||
// Reset the positioning and box size for correct width and height values. | ||
tooltip.css({ top: 0, left: 0, width: 'auto', height: 'auto' }); | ||
tooltip.css({ top: 0, left: 0, width: 'auto', height: 'auto', visibility: 'hidden' }); | ||
|
||
var ttBox = $position.position(tooltip); | ||
var ttCss = $position.positionElements(element, tooltip, ttScope.placement, appendToBody); | ||
|
@@ -227,8 +229,6 @@ angular.module('ui.bootstrap.tooltip', ['ui.bootstrap.position']) | |
ttScope.$apply(); // digest required as $apply is not called | ||
} | ||
|
||
tooltip.css({ display: 'block', visibility: 'hidden' }); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
wesleycho
Contributor
|
||
|
||
positionTooltip(); | ||
} | ||
|
||
|
@wesleycho @dabos-GFI Removing the display: 'block' on the tooltip css breaks the popover implementation. Bootstrap starts with a display: none on the popover style. Proposed fix would be to add display: block to the style attribute added on the template.