diff --git a/svelte-app/src/components/portable-text/image-carousel.svelte b/svelte-app/src/components/portable-text/image-carousel.svelte index 659d5ef6d..2ee3d9bda 100644 --- a/svelte-app/src/components/portable-text/image-carousel.svelte +++ b/svelte-app/src/components/portable-text/image-carousel.svelte @@ -15,7 +15,8 @@ dialog: HTMLDialogElement, currentIndex = 0; - const scrollIntoView = () => + const carouselMaxHeight = 402, + scrollIntoView = () => imageElements[currentIndex]?.scrollIntoView({ behavior: 'smooth', block: 'nearest', @@ -45,7 +46,6 @@ $: values = images.map((image) => { const crop = getCrop(image), baseUrl = urlFor(image.asset._ref), - carouselMaxHeight = 402, carouselDimensions = { width: carouselMaxHeight * (crop.width / crop.height), height: carouselMaxHeight @@ -70,12 +70,12 @@ {#each values as image, i}