I want MutationObserver
to see changes via innerHTML
#197
aarongustafson
started this conversation in
Wants
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
MutationObserver
is great. I use it, together withNode.matches()
, to initialize components;DOMContentLoaded
is now a thing of the past. It doesn't matter when or how new content gets inserted into a document,MutationObserver
is gonna be there, handling any post-processing. Now, as nice as this sounds, there is one thing that really sucks aboutMutationObserver
: it will not fire for nodes that are being inserted/created viainnerHTML
; only the outermost mutation will be seen and fire the event. This means that everytimeMutationObserver
fires, we have to query for nodes inside the target node and we need to track its children so we can then initialize all the new ones. Here’s an example; it’s super cumbersome! UpdatingMutationObserver
with the ability to see nodes inserted viainnerHTML
would help considerably.https://webwewant.fyi/wants/66/
Beta Was this translation helpful? Give feedback.
All reactions