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

Explicit check for leaf parent element presence for updates_for #208

Merged
merged 1 commit into from
Jun 1, 2022

Conversation

rickbenavidez
Copy link
Contributor

In certain scenarios, the call to recursive updates associated with updates_for may fail if the leaf's parent Element is null.

This results in an error similar to the following:
Uncaught TypeError: e2.parentElement is null

To prevent the error we'll perform an explicit check on the presence of the parent element before attempting to call closest().

@leastbad
Copy link
Contributor

Would you mind running yarn run prettier-standard:format and commiting again, please?

@rickbenavidez
Copy link
Contributor Author

Thanks for the review @leastbad! Command run, commit amended.

Copy link
Member

@marcoroth marcoroth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @rickbenavidez! This looks good from my side! 👍🏼

@leastbad leastbad merged commit c8573a3 into stimulusreflex:master Jun 1, 2022
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.

None yet

3 participants