Skip to content

Commit

Permalink
Renaming ENTER_KEY const
Browse files Browse the repository at this point in the history
  • Loading branch information
Galpittel committed Mar 14, 2024
1 parent 693fac0 commit e6ac1a2
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import {
clearGalleryItems,
} from '../../helpers/thumbnailsLogic';

const ENTER_KEY = 'Enter';

class NavigationPanel extends React.Component {
constructor(props) {
super(props);
Expand Down Expand Up @@ -51,7 +53,6 @@ class NavigationPanel extends React.Component {
activeIndexOffsetMemory: this.activeIndexOffsetMemory,
prevActiveIndex: this.prevActiveIndex,
});
const enterKey = 'Enter';

this.prevActiveIndex = activeIndex;
this.activeIndexOffsetMemory = activeIndexOffsetMemory;
Expand Down Expand Up @@ -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);
}
}}
Expand Down

0 comments on commit e6ac1a2

Please sign in to comment.