From 29010c0548925ca073b02c4c6ff9b15249519fc1 Mon Sep 17 00:00:00 2001 From: Galpittel Date: Thu, 14 Mar 2024 11:48:44 +0200 Subject: [PATCH] Renaming ENTER_KEY const --- .../src/components/gallery/proGallery/navigationPanel.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/gallery/src/components/gallery/proGallery/navigationPanel.js b/packages/gallery/src/components/gallery/proGallery/navigationPanel.js index 4df09f34b..509ad506b 100644 --- a/packages/gallery/src/components/gallery/proGallery/navigationPanel.js +++ b/packages/gallery/src/components/gallery/proGallery/navigationPanel.js @@ -4,6 +4,8 @@ import { GalleryUI } from '../../item/media/GalleryUI'; import TextItem from '../../item/textItem.js'; +const ENTER_KEY = 'Enter' + class NavigationPanel extends React.Component { constructor(props) { super(props); @@ -33,7 +35,6 @@ class NavigationPanel extends React.Component { activeIndexOffsetMemory: this.activeIndexOffsetMemory, prevActiveIndex: this.prevActiveIndex, }); - const enterKey = 'Enter'; this.prevActiveIndex = activeIndex; this.activeIndexOffsetMemory = activeIndexOffsetMemory; @@ -98,7 +99,7 @@ class NavigationPanel extends React.Component { onClick={() => this.scrollToThumbnail(idx)} tabIndex={0} onKeyDown={(e) => { - if (e.key === enterKey) { + if (e.key === ENTER_KEY) { this.scrollToThumbnail(idx); } }}