Skip to content

Commit

Permalink
Merge pull request #127 from arenadata/feature/ADH-5180
Browse files Browse the repository at this point in the history
feature/ADH-5180 send create rule form by hot keys shift+enter
  • Loading branch information
remizov-arena authored Nov 2, 2024
2 parents 9a6c925 + 0a0169e commit a7120d2
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ const RuleCreateDialog: React.FC = () => {
dispatch(createRuleWithUpdate(ruleText));
};

const handleKeyDown = (e: React.KeyboardEvent<HTMLTextAreaElement>) => {
if (e.shiftKey && e.key === 'Enter') {
e.preventDefault();
handleCreate();
}
};

return (
<FooterDialog
isOpen={isOpen}
Expand All @@ -55,7 +62,12 @@ const RuleCreateDialog: React.FC = () => {
actionButtonLabel="Create"
onAction={handleCreate}
>
<MultilineInput value={ruleText} onChange={handleChange} disabled={isActionInProgress} />
<MultilineInput
onKeyDown={handleKeyDown}
value={ruleText}
onChange={handleChange}
disabled={isActionInProgress}
/>
{isActionInProgress && <SpinnerPanel />}
</FooterDialog>
);
Expand Down

0 comments on commit a7120d2

Please sign in to comment.