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