fix: clicking on post image does not open the post but just shows the image in full screen (#362)

This commit is contained in:
Vojtech Simetka 2023-04-03 11:34:12 +02:00 committed by GitHub
parent 6c2ef2f9f7
commit 030abc8e54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -73,7 +73,10 @@
{#each post.images as image, index}
{#if index < MAX_IMAGES}
<!-- svelte-ignore a11y-click-events-have-key-events -->
<div class="child" on:click={() => (openedImageIndex = index)}>
<div
class="child"
on:click|preventDefault|stopPropagation={() => (openedImageIndex = index)}
>
<img src={adapter.getPicture(image)} alt="post" />
{#if index === MAX_IMAGES - 1 && post.images.length > MAX_IMAGES}
<div class="more">+{post.images.length - MAX_IMAGES}</div>