Component cannot be inserted into components
When the chat component is re-created, it stops working the second time.
It is a problem as a solid-[component]
may render multiple times. If we include a solid-xmpp-chat
in one of our components, it does not load.
Here is an example:
<head>
<script type="module" src="https://cdn.skypack.dev/@startinblox/core@0.17"></script>
<script type="module" src="https://cdn.skypack.dev/@startinblox/component-chat"></script>
<script type="module" src="https://unpkg.com/@startinblox/oidc@latest"></script>
</head>
<sib-auth auto-login
><sib-auth-provider
data-authority="https://api.fcpe-dev.startinblox.com/"
></sib-auth-provider>
</sib-auth>
<div id="chat">
</div>
<button id="test">Load chat</button>
<script>
document.addEventListener("DOMContentLoaded", () => {
test.onclick = () => {
document.querySelector("#chat").innerHTML = `
<solid-xmpp-chat
data-authentication="login"
data-auto-login="true"
data-websocket-url="wss://xmpp-dev.startinblox.com/xmpp-websocket"
uniq="1"
></solid-xmpp-chat>
`;
}
})
</script>
If you click on "Load chat" the first time, it loads.
A second time, it disappear and never loads again.
ping @balessan @jbpasquier @Francis