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

Target is missing for all mutation records #394

Closed
sionzee opened this issue Mar 9, 2022 · 1 comment
Closed

Target is missing for all mutation records #394

sionzee opened this issue Mar 9, 2022 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@sionzee
Copy link

sionzee commented Mar 9, 2022

Actually when you receive a MutationRecord from observer, there should be a specified target property.

At happy-dom the target is missing everywhere and that makes MutationObserver unusable.

there are few locations where I noticed the target is missing:

So for example if observer receives a callback about an attribute change, this is what you get:

    MutationRecord {
      type: 'attributes',
      target: null,
      addedNodes: [],
      removedNodes: [],
      previousSibling: null,
      nextSibling: null,
      attributeName: 'data-uuid',
      attributeNamespace: null,
      oldValue: null
    }

Here are docs for MutationRecord: https://developer.mozilla.org/en-US/docs/Web/API/MutationRecord

@sionzee sionzee changed the title Target is missing for all mutation events Target is missing for all mutation records Mar 9, 2022
@capricorn86 capricorn86 added the bug Something isn't working label Mar 10, 2022
@capricorn86 capricorn86 self-assigned this Mar 10, 2022
capricorn86 added a commit that referenced this issue Mar 10, 2022
…utation-records

#394@patch: Adds support for target in MutationRecord when using Muta…
@capricorn86
Copy link
Owner

Thank you for reporting @sionzee! 🙂

I have added support for target in MutationRecord now.

You can read more about the release here:
https://github.com/capricorn86/happy-dom/releases/tag/v2.46.2

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

2 participants