From 67ca751b3cf7753f6d5a3d98ebe957988e1bcbc6 Mon Sep 17 00:00:00 2001 From: Galpittel Date: Wed, 13 Mar 2024 11:13:35 +0200 Subject: [PATCH] [A11y] - Switching image using the Enter key Add the ability to switch the displayed image in the gallery by pressing the Enter key on one of the thumbnails. --- .../src/components/gallery/proGallery/navigationPanel.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/gallery/src/components/gallery/proGallery/navigationPanel.js b/packages/gallery/src/components/gallery/proGallery/navigationPanel.js index 439b3bc92..0d323ebc4 100644 --- a/packages/gallery/src/components/gallery/proGallery/navigationPanel.js +++ b/packages/gallery/src/components/gallery/proGallery/navigationPanel.js @@ -96,6 +96,11 @@ class NavigationPanel extends React.Component { style={itemStyle} onClick={() => this.scrollToThumbnail(idx)} tabIndex={0} + onKeyDown={(e) => { + if (e.key === 'Enter') { + this.scrollToThumbnail(idx); + } + }} > {thumbnailItem.type === 'video' && options[optionsMap.behaviourParams.item.video.enableThumbnailsPlayButton] && (