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

MutationObservers not able to observe() after disconnect() #1524

Closed
dtabuenc opened this issue Aug 31, 2024 · 1 comment · Fixed by #1525
Closed

MutationObservers not able to observe() after disconnect() #1524

dtabuenc opened this issue Aug 31, 2024 · 1 comment · Fixed by #1525
Assignees
Labels
bug Something isn't working

Comments

@dtabuenc
Copy link

dtabuenc commented Aug 31, 2024

Describe the bug

I'm not sure why but this commit 9a64097 added a new #destroyed field in the MutationObserverClass that is set to true on disconnect and then disallows observe to be called after disconnect:

As per the specification:

The MutationObserver method disconnect() tells the observer to stop watching for mutations.

The observer can be reused by calling its observe() method again.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new MutationObserver instance
  2. call .observe() method on it with appropriate parameters
  3. call .disconnect() method on instance to stop observing
  4. call.observe() again

Expected behavior
After disconnecting and observing again the mutation observer callback should continue to be called

@capricorn86
Copy link
Owner

Thank you for reporting @dtabuenc! 🙂

I believe that the bug has been fixed now.

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
2 participants