From 89c146b76293beada3d776822cd31ea8f8a0cf2a Mon Sep 17 00:00:00 2001 From: martylukyy <35452459+martylukyy@users.noreply.github.com> Date: Sat, 30 Dec 2023 18:07:40 +0100 Subject: [PATCH] enhancement(web): force run feed with enter key (#1329) --- web/src/components/modals/index.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/web/src/components/modals/index.tsx b/web/src/components/modals/index.tsx index 63b2bc3..55f683b 100644 --- a/web/src/components/modals/index.tsx +++ b/web/src/components/modals/index.tsx @@ -151,7 +151,7 @@ export const ForceRunModal: FC = (props: ForceRunModalProps) }, 200); }; - const handleForceRun = (e: React.MouseEvent) => { + const handleForceRun = (e: React.SyntheticEvent) => { e.preventDefault(); if (props.isOpen && isInputCorrect) { props.forceRunAction(); @@ -211,6 +211,11 @@ export const ForceRunModal: FC = (props: ForceRunModalProps) placeholder="Type 'I understand' to enable the button" value={inputValue} onChange={(e) => setInputValue(e.target.value)} + onKeyDown={(e) => { + if (e.key === "Enter") { + handleForceRun(e); + } + }} />