capture Mac command key

* remove tooltip
This commit is contained in:
Philipinho
2025-05-16 11:58:55 -07:00
parent 9ec688f679
commit 57cc41b2cf
2 changed files with 6 additions and 8 deletions

View File

@ -24,11 +24,9 @@ function CommentActions({
</Button> </Button>
)} )}
<Tooltip label={t("Ctrl + Enter")}> <Button size="compact-sm" loading={isLoading} onClick={onSave}>
<Button size="compact-sm" loading={isLoading} onClick={onSave}> {t("Save")}
{t("Save")} </Button>
</Button>
</Tooltip>
</Group> </Group>
); );
} }

View File

@ -29,7 +29,7 @@ const CommentEditor = forwardRef(
placeholder, placeholder,
autofocus, autofocus,
}: CommentEditorProps, }: CommentEditorProps,
ref ref,
) => { ) => {
const { t } = useTranslation(); const { t } = useTranslation();
const { ref: focusRef, focused } = useFocusWithin(); const { ref: focusRef, focused } = useFocusWithin();
@ -65,7 +65,7 @@ const CommentEditor = forwardRef(
} }
} }
if (event.ctrlKey && event.key === 'Enter') { if ((event.ctrlKey || event.metaKey) && event.key === "Enter") {
event.preventDefault(); event.preventDefault();
if (onSave) onSave(); if (onSave) onSave();
@ -106,7 +106,7 @@ const CommentEditor = forwardRef(
/> />
</div> </div>
); );
} },
); );
export default CommentEditor; export default CommentEditor;