fixes aria desc/label handling

This commit is contained in:
MinamiFunakoshiTR 2025-03-13 12:46:59 -07:00
parent 6789b4b92f
commit 8de33b6461
Failed to extract signature

View file

@ -203,7 +203,7 @@
ontouchstart={start}
onmousedown={start}
bind:this={figure}
aria-labelledby={(caption && `${id}-caption`) || undefined}
aria-labelledby={caption ? `${id}-caption` : undefined}
>
<img
bind:this={img}
@ -212,8 +212,9 @@
onload={measureLoadedImage}
style={imgStyle}
class="after absolute block m-0 max-w-full object-cover"
aria-describedby={(beforeOverlay && `${id}-before-description`) ||
undefined}
aria-describedby={beforeOverlay ?
`${id}-before-description`
: undefined}
/>
<img
@ -221,8 +222,9 @@
alt={beforeAlt}
style="clip: rect(0 {x}px {containerHeight}px 0);{imgStyle}"
class="before absolute block m-0 max-w-full object-cover"
aria-describedby={(afterOverlay && `${id}-after-description`) ||
undefined}
aria-describedby={afterOverlay ?
`${id}-after-description`
: undefined}
/>
{#if beforeOverlay}
<div