Skip to content

Commit

Permalink
refactor(hxTooltip): refactor behavior for compatibility audit
Browse files Browse the repository at this point in the history
  • Loading branch information
catsiller committed Jan 9, 2019
1 parent 94e084d commit faad721
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/helix-ui/elements/HXTooltipElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ export class HXTooltipElement extends _ProtoClass {

switch (attr) {
case 'for':
// FIXME: only run if connected to DOM
this._connectToControl();
break;

Expand All @@ -94,12 +93,8 @@ export class HXTooltipElement extends _ProtoClass {
* @returns {HTMLElement|undefined}
*/
get controlElement () {
let rootNode = this.getRootNode();

// FIXME: use `if (this.isConnected) { ... }`
if (rootNode !== this) {
// FIXME: replace getElementById() with querySelector()
return rootNode.getElementById(this.htmlFor);
if (this.isConnected) {
return this.getRootNode().querySelector(`#${this.htmlFor}`);
}
}

Expand Down Expand Up @@ -132,7 +127,6 @@ export class HXTooltipElement extends _ProtoClass {
return false;
}

// FIXME: getRootNode() will not return document context before connect
return (this.getRootNode().activeElement === ctrl);
}

Expand Down

0 comments on commit faad721

Please sign in to comment.