aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/ui/input
diff options
context:
space:
mode:
authorLibravatar Vijay A <vraravam@users.noreply.github.com>2024-04-19 09:02:56 +0530
committerLibravatar Vijay Aravamudhan <vraravam@users.noreply.github.com>2024-04-19 03:52:01 +0000
commit03a12413d632a2a1613091e44c52ce46b4adc5b8 (patch)
tree0086e0f98a644df91644b9cdde5ca1515188113a /src/components/ui/input
parent6.7.3-nightly.13 [skip ci] (diff)
downloadferdium-app-03a12413d632a2a1613091e44c52ce46b4adc5b8.tar.gz
ferdium-app-03a12413d632a2a1613091e44c52ce46b4adc5b8.tar.zst
ferdium-app-03a12413d632a2a1613091e44c52ce46b4adc5b8.zip
Minor refactoring to move repeated code into utility class
Diffstat (limited to 'src/components/ui/input')
-rw-r--r--src/components/ui/input/index.tsx3
1 files changed, 2 insertions, 1 deletions
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 {
16 injectIntl, 16 injectIntl,
17} from 'react-intl'; 17} from 'react-intl';
18import withStyles, { type WithStylesProps } from 'react-jss'; 18import withStyles, { type WithStylesProps } from 'react-jss';
19import { isEnterKeyPress } from '../../../jsUtils';
19// biome-ignore lint/suspicious/noShadowRestrictedNames: <explanation> 20// biome-ignore lint/suspicious/noShadowRestrictedNames: <explanation>
20import Error from '../error'; 21import Error from '../error';
21import Icon from '../icon'; 22import Icon from '../icon';
@@ -96,7 +97,7 @@ class Input extends Component<IProps, IState> {
96 } 97 }
97 98
98 onInputKeyPress(e: KeyboardEvent<HTMLInputElement>): void { 99 onInputKeyPress(e: KeyboardEvent<HTMLInputElement>): void {
99 if (e.key === 'Enter') { 100 if (isEnterKeyPress(e.key)) {
100 const { onEnterKey = noop } = this.props; 101 const { onEnterKey = noop } = this.props;
101 onEnterKey(); 102 onEnterKey();
102 } 103 }