Skip to content

Commit 9b194e6

Browse files
committed
refactor: use ctrl+enter to confirm in relation creation at relation map page
1 parent ae05a7a commit 9b194e6

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

apps/client/src/widgets/dialogs/prompt.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export default function PromptDialog() {
6969
submitValue.current = null;
7070
opts.current = undefined;
7171
}}
72-
footer={<Button text={t("prompt.ok")} keyboardShortcut="Enter" kind="primary" />}
72+
footer={<Button text={t("prompt.ok")} keyboardShortcut="ctrl+return" kind="primary" />}
7373
show={shown}
7474
stackable
7575
>
@@ -78,6 +78,13 @@ export default function PromptDialog() {
7878
inputRef={answerRef}
7979
currentValue={value} onChange={setValue}
8080
readOnly={opts.current?.readOnly}
81+
onKeyDown={(e: KeyboardEvent) => {
82+
if ((e.ctrlKey || e.metaKey) && e.key === "Enter") {
83+
e.preventDefault();
84+
submitValue.current = answerRef.current?.value || value;
85+
setShown(false);
86+
}
87+
}}
8188
/>
8289
</FormGroup>
8390
</Modal>

0 commit comments

Comments
 (0)