mirror of
https://github.com/docmost/docmost.git
synced 2026-05-16 22:41:30 +08:00
fix: ctrl-k behavior on macOS (#2052)
* Improve cmd-k / ctrl-k behavior Use cmd-k on macOS/iOS for search and keep ctrl-k everywhere else. Fixes a bug where ctrl-k on macOS, which cuts to the end of the line, was also triggering the search prompt. * comment submit: cmd-enter (mac) / ctrl-enter (win/linux)
This commit is contained in:
@@ -10,6 +10,7 @@ import { useTranslation } from "react-i18next";
|
||||
import EmojiCommand from "@/features/editor/extensions/emoji-command";
|
||||
import mentionRenderItems from "@/features/editor/components/mention/mention-suggestion";
|
||||
import MentionView from "@/features/editor/components/mention/mention-view";
|
||||
import { platformModifierKey } from "@/lib";
|
||||
|
||||
interface CommentEditorProps {
|
||||
defaultContent?: any;
|
||||
@@ -83,7 +84,7 @@ const CommentEditor = forwardRef(
|
||||
}
|
||||
}
|
||||
|
||||
if ((event.ctrlKey || event.metaKey) && event.key === "Enter") {
|
||||
if (platformModifierKey(event) && event.code === "Enter") {
|
||||
event.preventDefault();
|
||||
if (onSave) onSave();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user