Skip to content

Commit

Permalink
πŸ› Fix issue where accessing tooltip event target gave dead object error
Browse files Browse the repository at this point in the history
  • Loading branch information
kierandrewett committed Feb 4, 2024
1 parent eec66b8 commit 934130b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions actors/DotTooltipListenerChild.sys.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,16 @@ export class DotTooltipListenerChild extends JSWindowActorChild {
* @param {MouseEvent} event
*/
showTooltip(event) {
// Check if event is still accessible, the node
// holding the tooltip may have been purged from
// the DOM, resulting in a "dead object" error on
// the event.
try {
event.target;
} catch (e) {
return;
}

const target = this.getEventTarget(event);

const tooltipTarget = DOMUtils.shadowClosest(target, "[tooltip]");
Expand Down

0 comments on commit 934130b

Please sign in to comment.