react-tooltip 6.0.5 → 6.0.6

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,7 @@
257
257
  function resolveDataTooltipAnchor(targetElement, tooltipId) {
258
258
  let currentElement = targetElement;
259
259
  while (currentElement) {
260
- if (currentElement.dataset.tooltipId === tooltipId) {
260
+ if (currentElement instanceof HTMLElement && currentElement.dataset.tooltipId === tooltipId) {
261
261
  return currentElement;
262
262
  }
263
263
  currentElement = currentElement.parentElement;
@@ -703,10 +703,10 @@
703
703
  const dataTooltipId = anchorSelector ? parseDataTooltipIdSelector(anchorSelector) : null;
704
704
  resolveAnchorElementRef.current = (target) => {
705
705
  var _a, _b;
706
- const targetElement = target;
707
- if (!(targetElement === null || targetElement === void 0 ? void 0 : targetElement.isConnected)) {
706
+ if (!(target instanceof Element) || !target.isConnected) {
708
707
  return null;
709
708
  }
709
+ const targetElement = target;
710
710
  if (dataTooltipId) {
711
711
  const matchedAnchor = resolveDataTooltipAnchor(targetElement, dataTooltipId);
712
712
  if (matchedAnchor && !(disableTooltip === null || disableTooltip === void 0 ? void 0 : disableTooltip(matchedAnchor))) {