|
|
@@ -35,10 +35,7 @@ const ClosableTextInput: FC<ClosableTextInputProps> = memo((props: ClosableTextI
|
|
|
setAlertInfo(alertInfo);
|
|
|
};
|
|
|
|
|
|
- const onKeyDownHandler = (e) => {
|
|
|
- if (e.key !== 'Enter') {
|
|
|
- return;
|
|
|
- }
|
|
|
+ const onPressEnter = () => {
|
|
|
if (props.onPressEnter == null) {
|
|
|
return;
|
|
|
}
|
|
|
@@ -46,6 +43,16 @@ const ClosableTextInput: FC<ClosableTextInputProps> = memo((props: ClosableTextI
|
|
|
props.onPressEnter();
|
|
|
};
|
|
|
|
|
|
+ const onKeyDownHandler = (e) => {
|
|
|
+ switch (e.key) {
|
|
|
+ case 'Enter':
|
|
|
+ onPressEnter();
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
/*
|
|
|
* Hide when click outside the ref
|
|
|
*/
|