Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/transition/ios.transition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,14 @@ const animateFixedBackButton = (
});
root.afterAddWrite(() => {
buttons.forEach(({ element, visibility }) => (element.style.visibility = visibility));
cloneParent.insertBefore(clone, cloneNextSibling);
// The sibling captured at build time may have left the DOM during the
// transition; insertBefore would then throw NotFoundError and the
// transition would never settle.
if (cloneNextSibling && cloneNextSibling.parentNode === cloneParent) {
cloneParent.insertBefore(clone, cloneNextSibling);
} else {
cloneParent.appendChild(clone);
}
if (cloneStyle === null) {
clone.removeAttribute('style');
} else {
Expand Down