diff --git a/src/js/main-scroll.js b/src/js/main-scroll.js index 6a447f3cd..150d5c96a 100644 --- a/src/js/main-scroll.js +++ b/src/js/main-scroll.js @@ -290,7 +290,10 @@ class MainScroll { pswp.currSlide = this.itemHolders[1].slide; pswp.contentLoader.updateLazy(positionDifference); - pswp.currSlide.applyCurrentZoomPan(); + if (pswp.currSlide) { + pswp.currSlide.applyCurrentZoomPan(); + } + pswp.dispatch('change'); } diff --git a/src/js/slide/content.js b/src/js/slide/content.js index b6b7152b2..c7468c316 100644 --- a/src/js/slide/content.js +++ b/src/js/slide/content.js @@ -417,7 +417,7 @@ class Content { // purposefully using finally instead of then, // as if srcset sizes changes dynamically - it may cause decode error /** @type {HTMLImageElement} */ - (this.element).decode().finally(() => { + (this.element).decode().catch(() => {}).finally(() => { this.isDecoding = false; this.appendImage(); }); diff --git a/src/js/slide/placeholder.js b/src/js/slide/placeholder.js index d1d7b2d10..732349e5f 100644 --- a/src/js/slide/placeholder.js +++ b/src/js/slide/placeholder.js @@ -24,7 +24,7 @@ class Placeholder { this.element.setAttribute('role', 'presentation'); } - this.element.setAttribute('aria-hiden', 'true'); + this.element.setAttribute('aria-hidden', 'true'); } /** diff --git a/src/js/util/util.js b/src/js/util/util.js index 907edff13..30c993f95 100644 --- a/src/js/util/util.js +++ b/src/js/util/util.js @@ -154,7 +154,7 @@ export function removeTransitionStyle(el) { */ export function decodeImage(img) { if ('decode' in img) { - return img.decode(); + return img.decode().catch(() => {}); } if (img.complete) {