Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit 42cff13

Browse files
breezewishThomasBurleson
authored andcommitted
fix(tooltip): content text was semi-opaque
Closes #1480. Closes #1492.
1 parent ffbea7d commit 42cff13

2 files changed

Lines changed: 18 additions & 6 deletions

File tree

src/components/tooltip/tooltip.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ function MdTooltipDirective($timeout, $window, $$rAF, $document, $mdUtil, $mdThe
5757
$mdTheming(element);
5858
var parent = element.parent();
5959
var background = angular.element(element[0].getElementsByClassName('md-background')[0]);
60+
var content = angular.element(element[0].getElementsByClassName('md-content')[0]);
6061
var direction = attr.mdDirection;
6162

6263
// Keep looking for a higher parent if our current one has no pointer events
@@ -131,11 +132,13 @@ function MdTooltipDirective($timeout, $window, $$rAF, $document, $mdUtil, $mdThe
131132
positionTooltip();
132133
$animate.addClass(element, 'md-show');
133134
$animate.addClass(background, 'md-show');
135+
$animate.addClass(content, 'md-show');
134136
}
135137

136138
function hideTooltip() {
137139
parent.removeAttr('aria-describedby');
138140
$q.all([
141+
$animate.removeClass(content, 'md-show'),
139142
$animate.removeClass(background, 'md-show'),
140143
$animate.removeClass(element, 'md-show')
141144
]).then(function () {

src/components/tooltip/tooltip.scss

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,28 @@ md-tooltip {
3030
}
3131

3232
.md-content {
33+
position: relative;
3334
max-width: 240px;
3435
white-space: nowrap;
3536
overflow: hidden;
3637
text-overflow: ellipsis;
3738

3839
padding: 8px;
3940
background: transparent;
40-
opacity: 0.3;
41-
transition: inherit;
41+
opacity: 0;
42+
&.md-show-add {
43+
transition: $swift-ease-out;
44+
opacity: 0;
45+
}
46+
&.md-show, &.md-show-add-active {
47+
opacity: 1;
48+
}
49+
&.md-show-remove {
50+
transition: $swift-ease-in;
51+
&.md-show-remove-active {
52+
opacity: 0;
53+
}
54+
}
4255
}
4356

4457
&.md-hide {
@@ -49,9 +62,5 @@ md-tooltip {
4962
transition: $swift-ease-out;
5063
pointer-events: auto;
5164
transform: translate3d(0,0,0);
52-
53-
.md-content {
54-
opacity: 0.99;
55-
}
5665
}
5766
}

0 commit comments

Comments
 (0)