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

Conflict with Chrome extension #110

Closed
joedixon opened this issue Jan 19, 2020 · 1 comment
Closed

Conflict with Chrome extension #110

joedixon opened this issue Jan 19, 2020 · 1 comment

Comments

@joedixon
Copy link

joedixon commented Jan 19, 2020

I use a Chrome extension called WhatFont

This seems to be adding a spurious div to my page with no parent element. This causes an error in the console. It doesn't break anything, but it would be nice to get rid of the error.

Screenshot 2020-01-19 at 20 52 33

I have done some digging in the code and I think it can be solved by adding an extra check when setting up the MutationObserver as below:

if (node.nodeType !== 1) return

// ADD THIS EXTRA CHECK TO ENSURE THE NODE HAS A PARENT
// Check the node has a parent
if (!node.parentElement) return;

// Discard any changes happening within an existing component.
// They will take care of themselves.
if (node.parentElement.closest('[x-data]')) return

But I've never used this class before and only just started dabbling with the framework so wanted to run it by you first in case there is anything that this could break.

Lmk - happy to submit a PR if you think the solution works.

Thanks,
Joe

@calebporzio
Copy link
Collaborator

Should be fixed in the next release. Re-open if not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants