enhancement(web): force run feed with enter key (#1329)

This commit is contained in:
martylukyy 2023-12-30 18:07:40 +01:00 committed by GitHub
parent 57a91bb99a
commit 89c146b762
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -151,7 +151,7 @@ export const ForceRunModal: FC<ForceRunModalProps> = (props: ForceRunModalProps)
}, 200); }, 200);
}; };
const handleForceRun = (e: React.MouseEvent<HTMLButtonElement>) => { const handleForceRun = (e: React.SyntheticEvent) => {
e.preventDefault(); e.preventDefault();
if (props.isOpen && isInputCorrect) { if (props.isOpen && isInputCorrect) {
props.forceRunAction(); props.forceRunAction();
@ -211,6 +211,11 @@ export const ForceRunModal: FC<ForceRunModalProps> = (props: ForceRunModalProps)
placeholder="Type 'I understand' to enable the button" placeholder="Type 'I understand' to enable the button"
value={inputValue} value={inputValue}
onChange={(e) => setInputValue(e.target.value)} onChange={(e) => setInputValue(e.target.value)}
onKeyDown={(e) => {
if (e.key === "Enter") {
handleForceRun(e);
}
}}
/> />
</div> </div>