chrisdavies / tlite

A tiny tooltip utility library.
https://chrisdavies.github.io/tlite/
90 stars 19 forks source link

script DOM exceptions #17

Closed cameronbraid closed 6 years ago

cameronbraid commented 6 years ago

In Safari I get

NotFoundError: DOM Exception 8

in Chrome I get

Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.

the error happens at tooltipEl && el.removeChild(tooltipEl);

      function hide(isAutoHiding) {
        if (isAuto === isAutoHiding) {
          showTimer = clearTimeout(showTimer);
          tooltipEl && el.removeChild(tooltipEl);
          tooltipEl = undefined;
        }
      }

I havn't reproduced the exact cause, however these errors are being tracked by our sentry.io instance

chrisdavies commented 6 years ago

Interesting. It sounds like the underlying node has changed and the tooltip element has been removed from it via some process other than tlite itself. I think the fix is pretty simple. I'll push it in a bit.

chrisdavies commented 6 years ago

Should be good to go in 0.1.7. Let me know if you still see the problem after upgrading.

Thanks for reporting it!

cameronbraid commented 6 years ago

Thanks for the quick response.
That will certianly fix it.