diff --git a/apps/dokploy/components/dashboard/application/environment/show-environment.tsx b/apps/dokploy/components/dashboard/application/environment/show-environment.tsx index 86f7a0dff..1a7d78ee5 100644 --- a/apps/dokploy/components/dashboard/application/environment/show-environment.tsx +++ b/apps/dokploy/components/dashboard/application/environment/show-environment.tsx @@ -116,7 +116,7 @@ export const ShowEnvironment = ({ id, type }: Props) => { // Add keyboard shortcut for Ctrl+S/Cmd+S useEffect(() => { const handleKeyDown = (e: KeyboardEvent) => { - if ((e.ctrlKey || e.metaKey) && e.key === "s" && !isPending) { + if ((e.ctrlKey || e.metaKey) && e.code === "KeyS" && !isPending) { e.preventDefault(); form.handleSubmit(onSubmit)(); } diff --git a/apps/dokploy/components/dashboard/application/environment/show.tsx b/apps/dokploy/components/dashboard/application/environment/show.tsx index fcfd81778..fb5fc18a7 100644 --- a/apps/dokploy/components/dashboard/application/environment/show.tsx +++ b/apps/dokploy/components/dashboard/application/environment/show.tsx @@ -106,7 +106,7 @@ export const ShowEnvironment = ({ applicationId }: Props) => { // Add keyboard shortcut for Ctrl+S/Cmd+S useEffect(() => { const handleKeyDown = (e: KeyboardEvent) => { - if ((e.ctrlKey || e.metaKey) && e.key === "s" && !isPending) { + if ((e.ctrlKey || e.metaKey) && e.code === "KeyS" && !isPending) { e.preventDefault(); form.handleSubmit(onSubmit)(); } diff --git a/apps/dokploy/components/dashboard/compose/general/compose-file-editor.tsx b/apps/dokploy/components/dashboard/compose/general/compose-file-editor.tsx index 28f958e3e..e9d024fd3 100644 --- a/apps/dokploy/components/dashboard/compose/general/compose-file-editor.tsx +++ b/apps/dokploy/components/dashboard/compose/general/compose-file-editor.tsx @@ -95,7 +95,7 @@ export const ComposeFileEditor = ({ composeId }: Props) => { // Add keyboard shortcut for Ctrl+S/Cmd+S useEffect(() => { const handleKeyDown = (e: KeyboardEvent) => { - if ((e.ctrlKey || e.metaKey) && e.key === "s" && !isPending) { + if ((e.ctrlKey || e.metaKey) && e.code === "KeyS" && !isPending) { e.preventDefault(); form.handleSubmit(onSubmit)(); } diff --git a/apps/dokploy/components/dashboard/project/environment-variables.tsx b/apps/dokploy/components/dashboard/project/environment-variables.tsx index b4ed3f8cb..2826e2bcb 100644 --- a/apps/dokploy/components/dashboard/project/environment-variables.tsx +++ b/apps/dokploy/components/dashboard/project/environment-variables.tsx @@ -88,7 +88,12 @@ export const EnvironmentVariables = ({ environmentId, children }: Props) => { // Add keyboard shortcut for Ctrl+S/Cmd+S useEffect(() => { const handleKeyDown = (e: KeyboardEvent) => { - if ((e.ctrlKey || e.metaKey) && e.key === "s" && !isPending && isOpen) { + if ( + (e.ctrlKey || e.metaKey) && + e.code === "KeyS" && + !isPending && + isOpen + ) { e.preventDefault(); form.handleSubmit(onSubmit)(); } diff --git a/apps/dokploy/components/dashboard/projects/project-environment.tsx b/apps/dokploy/components/dashboard/projects/project-environment.tsx index 46e5d1f54..ba70bb971 100644 --- a/apps/dokploy/components/dashboard/projects/project-environment.tsx +++ b/apps/dokploy/components/dashboard/projects/project-environment.tsx @@ -87,7 +87,12 @@ export const ProjectEnvironment = ({ projectId, children }: Props) => { // Add keyboard shortcut for Ctrl+S/Cmd+S useEffect(() => { const handleKeyDown = (e: KeyboardEvent) => { - if ((e.ctrlKey || e.metaKey) && e.key === "s" && !isPending && isOpen) { + if ( + (e.ctrlKey || e.metaKey) && + e.code === "KeyS" && + !isPending && + isOpen + ) { e.preventDefault(); form.handleSubmit(onSubmit)(); } diff --git a/apps/dokploy/components/dashboard/search-command.tsx b/apps/dokploy/components/dashboard/search-command.tsx index b98099b5f..9946a54a9 100644 --- a/apps/dokploy/components/dashboard/search-command.tsx +++ b/apps/dokploy/components/dashboard/search-command.tsx @@ -63,7 +63,7 @@ export const SearchCommand = () => { React.useEffect(() => { const down = (e: KeyboardEvent) => { - if (e.key === "j" && (e.metaKey || e.ctrlKey)) { + if (e.code === "KeyJ" && (e.metaKey || e.ctrlKey)) { e.preventDefault(); setOpen((open) => !open); } diff --git a/apps/dokploy/components/dashboard/settings/web-server/edit-traefik-env.tsx b/apps/dokploy/components/dashboard/settings/web-server/edit-traefik-env.tsx index 3f63fbc90..1312b96c5 100644 --- a/apps/dokploy/components/dashboard/settings/web-server/edit-traefik-env.tsx +++ b/apps/dokploy/components/dashboard/settings/web-server/edit-traefik-env.tsx @@ -87,7 +87,12 @@ export const EditTraefikEnv = ({ children, serverId }: Props) => { // Add keyboard shortcut for Ctrl+S/Cmd+S useEffect(() => { const handleKeyDown = (e: KeyboardEvent) => { - if ((e.ctrlKey || e.metaKey) && e.key === "s" && !isPending && !canEdit) { + if ( + (e.ctrlKey || e.metaKey) && + e.code === "KeyS" && + !isPending && + !canEdit + ) { e.preventDefault(); form.handleSubmit(onSubmit)(); } diff --git a/apps/dokploy/components/shared/focus-shortcut-input.tsx b/apps/dokploy/components/shared/focus-shortcut-input.tsx index 9c9215236..8bdc72f57 100644 --- a/apps/dokploy/components/shared/focus-shortcut-input.tsx +++ b/apps/dokploy/components/shared/focus-shortcut-input.tsx @@ -9,7 +9,7 @@ export const FocusShortcutInput = (props: Props) => { useEffect(() => { const onKeyDown = (e: KeyboardEvent) => { const isMod = e.metaKey || e.ctrlKey; - if (!isMod || e.key.toLowerCase() !== "k") return; + if (!isMod || e.code !== "KeyK") return; const target = e.target as HTMLElement | null; if (target) { diff --git a/apps/dokploy/components/ui/sidebar.tsx b/apps/dokploy/components/ui/sidebar.tsx index a146a4f97..c198eaecc 100644 --- a/apps/dokploy/components/ui/sidebar.tsx +++ b/apps/dokploy/components/ui/sidebar.tsx @@ -22,7 +22,7 @@ const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7; const SIDEBAR_WIDTH = "16rem"; const SIDEBAR_WIDTH_MOBILE = "18rem"; const SIDEBAR_WIDTH_ICON = "3rem"; -const SIDEBAR_KEYBOARD_SHORTCUT = "b"; +const SIDEBAR_KEYBOARD_SHORTCUT = "KeyB"; type SidebarContext = { state: "expanded" | "collapsed"; @@ -99,7 +99,7 @@ const SidebarProvider = React.forwardRef< React.useEffect(() => { const handleKeyDown = (event: KeyboardEvent) => { if ( - event.key === SIDEBAR_KEYBOARD_SHORTCUT && + event.code === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey) ) { event.preventDefault();