react-tooltip 6.0.6 → 6.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -258,7 +258,8 @@ function parseDataTooltipIdSelector(selector) {
258
258
  function resolveDataTooltipAnchor(targetElement, tooltipId) {
259
259
  let currentElement = targetElement;
260
260
  while (currentElement) {
261
- if (currentElement instanceof HTMLElement && currentElement.dataset.tooltipId === tooltipId) {
261
+ const dataset = currentElement.dataset;
262
+ if ((dataset === null || dataset === void 0 ? void 0 : dataset.tooltipId) === tooltipId) {
262
263
  return currentElement;
263
264
  }
264
265
  currentElement = currentElement.parentElement;
@@ -793,7 +794,7 @@ const useTooltipEvents = ({ activeAnchor, anchorElements, anchorSelector, clicka
793
794
  const addDelegatedListener = (eventType, listener, options) => {
794
795
  cleanupFns.push(addDelegatedEventListener(eventType, listener, options));
795
796
  };
796
- const activeAnchorContainsTarget = (event) => { var _a; return Boolean((event === null || event === void 0 ? void 0 : event.target) && ((_a = activeAnchorRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target))); };
797
+ const activeAnchorContainsTarget = (event) => { var _a; return Boolean((event === null || event === void 0 ? void 0 : event.target) instanceof Node && ((_a = activeAnchorRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target))); };
797
798
  const debouncedHandleShowTooltip = (anchor) => {
798
799
  debouncedHide.cancel();
799
800
  debouncedShow(anchor);
@@ -823,7 +824,7 @@ const useTooltipEvents = ({ activeAnchor, anchorElements, anchorSelector, clicka
823
824
  }
824
825
  const relatedTarget = event.relatedTarget;
825
826
  const containerAnchor = targetAnchor || activeAnchorRef.current;
826
- if (containerAnchor === null || containerAnchor === void 0 ? void 0 : containerAnchor.contains(relatedTarget)) {
827
+ if (relatedTarget instanceof Node && (containerAnchor === null || containerAnchor === void 0 ? void 0 : containerAnchor.contains(relatedTarget))) {
827
828
  return;
828
829
  }
829
830
  debouncedHandleHideTooltip();
@@ -854,7 +855,7 @@ const useTooltipEvents = ({ activeAnchor, anchorElements, anchorSelector, clicka
854
855
  }
855
856
  const relatedTarget = event.relatedTarget;
856
857
  const containerAnchor = targetAnchor || activeAnchorRef.current;
857
- if (containerAnchor === null || containerAnchor === void 0 ? void 0 : containerAnchor.contains(relatedTarget)) {
858
+ if (relatedTarget instanceof Node && (containerAnchor === null || containerAnchor === void 0 ? void 0 : containerAnchor.contains(relatedTarget))) {
858
859
  return;
859
860
  }
860
861
  debouncedHandleHideTooltip();
@@ -984,7 +985,7 @@ const useTooltipEvents = ({ activeAnchor, anchorElements, anchorSelector, clicka
984
985
  return;
985
986
  }
986
987
  const target = event.target;
987
- if (!(target === null || target === void 0 ? void 0 : target.isConnected)) {
988
+ if (!(target instanceof Node) || !target.isConnected) {
988
989
  return;
989
990
  }
990
991
  if ((_a = tooltipRef.current) === null || _a === void 0 ? void 0 : _a.contains(target)) {