Fix bug where an empty title would cause a sticky tooltip

+ A tooltip should not show if the title attribute is present but
  empty.
+ It should always hide the tooltip, even IF it’s empty.

Change-Id: I4e4ba6596da3f5dbf871077b66459cfdc624e26d
This commit is contained in:
Andrew Bonventre
2016-06-09 16:18:53 -04:00
parent afe1cef1ab
commit 21bfc53e6c

View File

@@ -40,7 +40,11 @@
},
_handleShowTooltip: function(e) {
if (!this.hasAttribute('title') || this._tooltip) { return; }
if (!this.hasAttribute('title') ||
this.getAttribute('title') === '' ||
this._tooltip) {
return;
}
// Store the title attribute text then set it to an empty string to
// prevent it from showing natively.
@@ -62,7 +66,7 @@
_handleHideTooltip: function(e) {
if (!this.hasAttribute('title') ||
!this._titleText ||
this._titleText == null ||
this === document.activeElement) { return; }
this.setAttribute('title', this._titleText);