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

fix(runtime): append newChild if parent node doesn't match with patched node #6141

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

itsjustaplant
Copy link

@itsjustaplant itsjustaplant commented Feb 4, 2025

What is the current behavior?

GitHub Issue Number: #6140

What is the new behavior?

If patched node (this) is not the same node of currentChild, it uses appendChild to insert the newChild to patched node

Documentation

Does this introduce a breaking change?

  • Yes
  • No

Testing

Other information

@itsjustaplant itsjustaplant requested a review from a team as a code owner February 4, 2025 11:18
@christian-bromann
Copy link
Member

christian-bromann commented Feb 4, 2025

@itsjustaplant thanks for raising the PR, mind creating a test to ensure we don't regress on this? I recommend to create a WebdriverIO test as it provides the most flexibility creating the test. Let me know if you have any questions.

@itsjustaplant itsjustaplant force-pushed the fix/runtime_patchInsertBefore_node_not_found_error branch from cba9889 to 19db966 Compare February 5, 2025 13:13
@itsjustaplant itsjustaplant changed the title fix(runtime): use unpatched parentNode as a fallback while inserting … fix(runtime): append newChild if parent node doesn't match with patched node Feb 5, 2025
@itsjustaplant
Copy link
Author

Hi @christian-bromann , I am unable to reproduce this issue in either a plain Stencil app or WebdriverIO tests. I believe that this only happens in React apps. PS: I replaced the unpatched insertBefore with appendChild as a fallback method as i believe that appendChild is safer.

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.

2 participants