react-tooltip 6.0.5 → 6.0.6-beta.1280.rc.0

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.
@@ -257,7 +257,8 @@
257
257
  function resolveDataTooltipAnchor(targetElement, tooltipId) {
258
258
  let currentElement = targetElement;
259
259
  while (currentElement) {
260
- if (currentElement.dataset.tooltipId === tooltipId) {
260
+ const dataset = currentElement.dataset;
261
+ if ((dataset === null || dataset === void 0 ? void 0 : dataset.tooltipId) === tooltipId) {
261
262
  return currentElement;
262
263
  }
263
264
  currentElement = currentElement.parentElement;
@@ -703,10 +704,10 @@
703
704
  const dataTooltipId = anchorSelector ? parseDataTooltipIdSelector(anchorSelector) : null;
704
705
  resolveAnchorElementRef.current = (target) => {
705
706
  var _a, _b;
706
- const targetElement = target;
707
- if (!(targetElement === null || targetElement === void 0 ? void 0 : targetElement.isConnected)) {
707
+ if (!(target instanceof Element) || !target.isConnected) {
708
708
  return null;
709
709
  }
710
+ const targetElement = target;
710
711
  if (dataTooltipId) {
711
712
  const matchedAnchor = resolveDataTooltipAnchor(targetElement, dataTooltipId);
712
713
  if (matchedAnchor && !(disableTooltip === null || disableTooltip === void 0 ? void 0 : disableTooltip(matchedAnchor))) {
@@ -792,7 +793,7 @@
792
793
  const addDelegatedListener = (eventType, listener, options) => {
793
794
  cleanupFns.push(addDelegatedEventListener(eventType, listener, options));
794
795
  };
795
- 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))); };
796
+ 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))); };
796
797
  const debouncedHandleShowTooltip = (anchor) => {
797
798
  debouncedHide.cancel();
798
799
  debouncedShow(anchor);
@@ -822,7 +823,7 @@
822
823
  }
823
824
  const relatedTarget = event.relatedTarget;
824
825
  const containerAnchor = targetAnchor || activeAnchorRef.current;
825
- if (containerAnchor === null || containerAnchor === void 0 ? void 0 : containerAnchor.contains(relatedTarget)) {
826
+ if (relatedTarget instanceof Node && (containerAnchor === null || containerAnchor === void 0 ? void 0 : containerAnchor.contains(relatedTarget))) {
826
827
  return;
827
828
  }
828
829
  debouncedHandleHideTooltip();
@@ -853,7 +854,7 @@
853
854
  }
854
855
  const relatedTarget = event.relatedTarget;
855
856
  const containerAnchor = targetAnchor || activeAnchorRef.current;
856
- if (containerAnchor === null || containerAnchor === void 0 ? void 0 : containerAnchor.contains(relatedTarget)) {
857
+ if (relatedTarget instanceof Node && (containerAnchor === null || containerAnchor === void 0 ? void 0 : containerAnchor.contains(relatedTarget))) {
857
858
  return;
858
859
  }
859
860
  debouncedHandleHideTooltip();
@@ -983,7 +984,7 @@
983
984
  return;
984
985
  }
985
986
  const target = event.target;
986
- if (!(target === null || target === void 0 ? void 0 : target.isConnected)) {
987
+ if (!(target instanceof Node) || !target.isConnected) {
987
988
  return;
988
989
  }
989
990
  if ((_a = tooltipRef.current) === null || _a === void 0 ? void 0 : _a.contains(target)) {