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 replaceWith bugfix for node argument that is already in document tree #84

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

fsw
Copy link
Collaborator

@fsw fsw commented Sep 11, 2023

Current implementation of replaceWith is missing setting _nextNode and _previousNode for siblings of the node argument (the one that replaces current node).

It is causing tree structure issues and bugs when replaceWith is called with an argument that is already in the same document tree (added test for it).

Cant find this documented but Dart and JS DOM versions of this method are simply moving the replacing element from the current location so guess this should work same way.

Refactored a little bit to avoid logic repetition.

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.

1 participant