From 03a12413d632a2a1613091e44c52ce46b4adc5b8 Mon Sep 17 00:00:00 2001 From: Vijay A Date: Fri, 19 Apr 2024 09:02:56 +0530 Subject: Minor refactoring to move repeated code into utility class --- src/components/ui/input/index.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/components/ui/input') diff --git a/src/components/ui/input/index.tsx b/src/components/ui/input/index.tsx index 225517ba8..7e3179baf 100644 --- a/src/components/ui/input/index.tsx +++ b/src/components/ui/input/index.tsx @@ -16,6 +16,7 @@ import { injectIntl, } from 'react-intl'; import withStyles, { type WithStylesProps } from 'react-jss'; +import { isEnterKeyPress } from '../../../jsUtils'; // biome-ignore lint/suspicious/noShadowRestrictedNames: import Error from '../error'; import Icon from '../icon'; @@ -96,7 +97,7 @@ class Input extends Component { } onInputKeyPress(e: KeyboardEvent): void { - if (e.key === 'Enter') { + if (isEnterKeyPress(e.key)) { const { onEnterKey = noop } = this.props; onEnterKey(); } -- cgit v1.2.3-70-g09d2