Skip to content

react-tooltip and iframes not working #71

@ccoffey

Description

@ccoffey

With the following iframe setup, react-tooltips do not work. I think it has something to do with events not working? Any advise?

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8" />
  <title>Test</title>
  <link rel='stylesheet' href='dist/index.css'>
</head>
<body>
  <div id='main'></div>
  <script>
    var iframe = document.createElement('iframe');
    iframe.style.display = 'none';
    document.body.appendChild(iframe);
    var content = "<!doctype html><head></head><body></body></html>";
    iframe.contentWindow.document.open('text/html', 'replace');
    iframe.contentWindow.document.write(content);
    iframe.contentWindow.document.close();

    var script = iframe.contentWindow.document.createElement("script");
    script.type = "text/javascript";
    script.src = "dist/index.js";
    iframe.contentWindow.document.body.appendChild(script);
  </script>
</body>
</html>

Full minimal not working example here: https://github.com/ccoffey/react-tooltip/commit/66a1e70266325b5198c5d26025133bc3ad4b6473

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions