Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
kirchsuSICKAG opened this issue May 31, 2023 · 1 comment
Assignees
Labels
bug Something isn't working
Milestone

Comments

@kirchsuSICKAG
Copy link
Collaborator

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.

@kirchsuSICKAG kirchsuSICKAG added the bug Something isn't working label May 31, 2023
@kirchsuSICKAG kirchsuSICKAG self-assigned this May 31, 2023
@kirchsuSICKAG kirchsuSICKAG added this to the v0.2.9 milestone May 31, 2023
@kirchsuSICKAG
Copy link
Collaborator Author

Fixed with version 0.2.9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant