From e6ac1a25742c0f76cb1f155a7804bbbbdb49a2fa Mon Sep 17 00:00:00 2001 From: Galpittel Date: Thu, 14 Mar 2024 12:12:01 +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 ca6f21e87..21db4c6d9 100644 --- a/packages/gallery/src/components/gallery/proGallery/navigationPanel.js +++ b/packages/gallery/src/components/gallery/proGallery/navigationPanel.js @@ -8,6 +8,8 @@ import { clearGalleryItems, } from '../../helpers/thumbnailsLogic'; +const ENTER_KEY = 'Enter'; + class NavigationPanel extends React.Component { constructor(props) { super(props); @@ -51,7 +53,6 @@ class NavigationPanel extends React.Component { activeIndexOffsetMemory: this.activeIndexOffsetMemory, prevActiveIndex: this.prevActiveIndex, }); - const enterKey = 'Enter'; this.prevActiveIndex = activeIndex; this.activeIndexOffsetMemory = activeIndexOffsetMemory; @@ -113,7 +114,7 @@ class NavigationPanel extends React.Component { style={itemStyle} onClick={() => this.scrollToThumbnail(idx)} onKeyDown={(e) => { - if (e.key === enterKey) { + if (e.key === ENTER_KEY) { this.scrollToThumbnail(idx); } }}