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

Check for existence of parent component first when filtering mutations #91

Merged
merged 2 commits into from
Jan 20, 2020

Conversation

thormeier
Copy link
Contributor

Suppresses an error caused by the parent component being null in some
cases.

Fixes #90.

Suppresses an error caused by the parent component being null in some
cases.
@thormeier thormeier changed the title Check for existence of parent component first when filtering mutations WIP: Check for existence of parent component first when filtering mutations Jan 16, 2020
@thormeier thormeier changed the title WIP: Check for existence of parent component first when filtering mutations Check for existence of parent component first when filtering mutations Jan 16, 2020
@calebporzio
Copy link
Collaborator

Hey @thormeier - what are the cases where it's null?

@thormeier
Copy link
Contributor Author

See #90 - I wasn't able to fully understand the interdependence between Choices and Alpine, but I'm almost sure it happens when the mutation target is removed from the DOM before the observer is triggered. That's at least what my observation yielded.

@joedixon
Copy link

I should have read through the PRs first, but I just ran into this same problem and raised and issue #110

I get a similar issue when I have the WhatFont Chrome extension enabled.

@ryatkins
Copy link

+1 Get this error as well. Running Chrome in Incognito Mode fixes the issue.

@calebporzio calebporzio merged commit 49c300d into alpinejs:master Jan 20, 2020
@calebporzio
Copy link
Collaborator

Thanks @thormeier.

Any chance you can write a test that simulates this behavior? I merged it, but because no test will fail if I roll it back - it could be refactored out in the future and the error could crop back up again.

Thanks.

@thormeier
Copy link
Contributor Author

@calebporzio Sure thing, will do a follow-up PR on this.

thormeier added a commit to thormeier/alpine that referenced this pull request Jan 22, 2020
@thormeier
Copy link
Contributor Author

@calebporzio Added a test here: #126

thormeier added a commit to thormeier/alpine that referenced this pull request Jan 23, 2020
calebporzio added a commit that referenced this pull request Jan 28, 2020
Add test for PR #91 regarding disconnected nodes and fix same issue while listening for new components.
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

Successfully merging this pull request may close these issues.

Error when mutation target is removed
4 participants