Skip to content

Commit

Permalink
refactor(Tooltip): use optional chaining
Browse files Browse the repository at this point in the history
  • Loading branch information
emyarod committed Jul 22, 2020
1 parent cc72d1e commit cd2d3a7
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions packages/react/src/components/Tooltip/Tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,9 +300,7 @@ class Tooltip extends Component {
const { current: triggerEl } = this._triggerRef;
const shouldPreventClose =
relatedTarget &&
((triggerEl &&
triggerEl.contains &&
triggerEl.contains(relatedTarget)) ||
((triggerEl && triggerEl?.contains(relatedTarget)) ||
(this._tooltipEl && this._tooltipEl.contains(relatedTarget)));
if (!shouldPreventClose) {
this._handleUserInputOpenClose(evt, { open: false });
Expand Down

0 comments on commit cd2d3a7

Please sign in to comment.