- From: Jack Works <notifications@github.com>
- Date: Wed, 26 May 2021 00:17:25 -0700
- To: whatwg/dom <dom@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Wednesday, 26 May 2021 07:17:38 UTC
If I understand this correctly, connected-ness means if a Node appears in the document or not. If so, I'd like to share my use case. I have a `span` element and I want to mount my application on it when the `span` has been inserted in the document (I cannot control when it will be mounted). If I mount the application on the `span` when it is disconnected, it will throw an error cause most of our code doesn't assume that. Now I have two choices, attach an event listener of deprecated `DOMNodeInserted` on the `span`, or add a `childList` `MutationObserver` on the whole document then use `document.contains`. I don't know which one hurts the performance mostly and they both don't seem like a good option. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/whatwg/dom/issues/533#issuecomment-848529573
Received on Wednesday, 26 May 2021 07:17:38 UTC