Hey @Atle - `closeModal` not only unregisters listeners but completely destroys any code running in the modal. The modal and panel work based on iframes, any code running in them will be discarded once they are closed.
If you want to have event subscriptions lasting for whole of the app lifecycle, you’ll need to do it in the headless iframe.
Cheers!
Chris
Thank you for the reply Chris.
What you explain makes sense, but i would not expect that closing the modal (with closeModal) would affect listeners registered by the panel.
Our current workaround is that we “reopen” the panel by calling openPanel again after calling closeModal.
Ah thanks for clarification. So we are talking about 2 headful UI components, modal and panel, and as per my understanding, the event subscription happens in the panel and then another modal is open. So when that the same modal is closed, the panel loses its events subscriptions.
If that’s the case, it’s not the expected behavior, I’ll work with the SDK team to investigate this further. Some code samples would be needed here, you can direct message me with these if that is more appropriate.
Yes, that is the case. I will DM you.