refactor: use ctrl+enter to confirm in relation creation at relation map page

This commit is contained in:
JYC333 2026-03-09 01:38:03 +00:00
parent 6a65c20fbb
commit d14dd07e55

View File

@ -69,7 +69,7 @@ export default function PromptDialog() {
submitValue.current = null;
opts.current = undefined;
}}
footer={<Button text={t("prompt.ok")} keyboardShortcut="Enter" kind="primary" />}
footer={<Button text={t("prompt.ok")} keyboardShortcut="ctrl+return" kind="primary" />}
show={shown}
stackable
>
@ -78,6 +78,13 @@ export default function PromptDialog() {
inputRef={answerRef}
currentValue={value} onChange={setValue}
readOnly={opts.current?.readOnly}
onKeyDown={(e: KeyboardEvent) => {
if ((e.ctrlKey || e.metaKey) && e.key === "Enter") {
e.preventDefault();
submitValue.current = answerRef.current?.value || value;
setShown(false);
}
}}
/>
</FormGroup>
</Modal>