mirror of
https://github.com/zadam/trilium.git
synced 2026-03-13 11:53:38 +01:00
refactor: use ctrl+enter to confirm in relation creation at relation map page
This commit is contained in:
parent
6a65c20fbb
commit
d14dd07e55
@ -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>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user