diff --git a/assets/media-gallery.js b/assets/media-gallery.js index 89c5d9d2a6e..7b8692cd716 100644 --- a/assets/media-gallery.js +++ b/assets/media-gallery.js @@ -46,7 +46,7 @@ if (!customElements.get('media-gallery')) { this.preventStickyHeader(); window.setTimeout(() => { - if (this.elements.thumbnails) { + if (!this.mql.matches || this.elements.thumbnails) { activeMedia.parentElement.scrollTo({ left: activeMedia.offsetLeft }); } const activeMediaRect = activeMedia.getBoundingClientRect();