Skip to content

Comments

Explicit check for leaf parent element presence for updates_for#208

Merged
leastbad merged 1 commit intostimulusreflex:masterfrom
rickbenavidez:fix-leaf-updates
Jun 1, 2022
Merged

Explicit check for leaf parent element presence for updates_for#208
leastbad merged 1 commit intostimulusreflex:masterfrom
rickbenavidez:fix-leaf-updates

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.

3 participants