Skip to content

Commit

Permalink
Insert a Node after some Node only when the former is not already…
Browse files Browse the repository at this point in the history
… at that position.
  • Loading branch information
Kapelianovych committed Apr 29, 2024
1 parent 5bec307 commit ebbd1ae
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/web/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ export const mount = renderer({
: instance.setAttribute(name, value);
},
insertInstanceAfter(_parent, previousSibling, nextSibling) {
previousSibling.after(nextSibling);
previousSibling.nextSibling === nextSibling ||
previousSibling.after(nextSibling);
},
createDefaultInstance(parent, element, position, isHydrating) {
if (element instanceof Node) {
Expand Down

0 comments on commit ebbd1ae

Please sign in to comment.