SICKAG/collage

Error when removing a collage-fragment from DOM, which itself does not use collage to be a collage-fragment by itself

kirchsuSICKAG opened this issue · 1 comments

Following error occurs, when removing a collage-fragment from the DOM, whose underlying application does not use collage:

image

Steps to reproduce the error:

  1. create a parent app which includes a child app via collage-fragment
    Example code parent:
     <script type="module">
      import { expose } from "@collage/core";
      expose().then((context) => {
        document.querySelector("#btn").addEventListener("click", () => {
          document.querySelector("#iframe").remove();
        });
      });
    </script>
    <button id="btn">Remove fragment without collage</button>
    <collage-fragment id="iframe"  url="./child.html"></collage-fragment>
  1. create a child app which should not use collage itself (child.html)
    <div>It does not matter what happens here</div>
  1. the parent element removes the collage-fragment from the DOM --> document.querySelector('collage-fragment').remove();

Note

If a collage fragment is created with an application that does not use collage itself, this will result in collage not being able to complete the handshake and therefore some collage features cannot be used.

Fixed with version 0.2.9