Merged in fix/sw-3703-fix-focus-in-lightbox-gallery (pull request #3521)
fix(SW-3703): Fix focus management in lightbox gallery * Add keys to fix focus Approved-by: Matilda Landström
This commit is contained in:
@@ -151,6 +151,7 @@ export function Gallery({
|
||||
{hasPrevImage && (
|
||||
<ThumbnailImage
|
||||
image={thumbnail.previous!}
|
||||
key="prev-lightbox-image"
|
||||
index={0}
|
||||
onSelect={onSelectImage}
|
||||
/>
|
||||
@@ -158,6 +159,7 @@ export function Gallery({
|
||||
<span className={styles.thumbnail}>
|
||||
{thumbnail.images.map((image, index) => (
|
||||
<ThumbnailImage
|
||||
key={image.src}
|
||||
image={image}
|
||||
index={hasPrevImage ? index + 1 : index}
|
||||
onSelect={onSelectImage}
|
||||
@@ -168,6 +170,7 @@ export function Gallery({
|
||||
{hasNextImage && (
|
||||
<ThumbnailImage
|
||||
image={thumbnail.next!}
|
||||
key="next-lightbox-image"
|
||||
index={6}
|
||||
onSelect={onSelectImage}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user