Skip to content

Commit

Permalink
reverse pantry restore direction and fix type check
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelWest22 committed Dec 14, 2024
1 parent 2bae8ff commit 377988f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/idiomorph.js
Original file line number Diff line number Diff line change
Expand Up @@ -1126,12 +1126,12 @@ var Idiomorph = (function () {

/**
*
* @param {Element} root
* @param {Node | null} root
* @param {MorphContext} ctx
*/
function restoreFromPantry(root, ctx) {
if (ctx.pantry instanceof HTMLDivElement) {
Array.from(ctx.pantry.children).forEach(element => {
if (ctx.pantry instanceof HTMLDivElement && root instanceof Element) {
Array.from(ctx.pantry.children).reverse().forEach(element => {
const matchElement = root.querySelector(`#${element.id}`);
if (matchElement) {
// @ts-ignore - use proposed moveBefore feature
Expand Down

0 comments on commit 377988f

Please sign in to comment.