Skip to content

⭐️⭐️⭐️ Open-source, self-hosted alternative to Linear and Plane. Project management and issue tracking where teams and AI agents work side by side to plan and ship products.

fix(web): keep Ctrl+B in text fields from toggling the sidebar (#469)

Croff451226c8cd5e
diff --git a/apps/web/src/components/ui/sidebar.tsx b/apps/web/src/components/ui/sidebar.tsx
index 6e270a1b..30c0d99a 100644
--- a/apps/web/src/components/ui/sidebar.tsx
+++ b/apps/web/src/components/ui/sidebar.tsx
@@ -8,6 +8,7 @@ import { useTranslations } from 'next-intl';
import { useIsMobile } from '@/hooks/use-mobile';
import { cn } from '@/lib/utils';
+import { isTypingTarget } from '@/utils/hotkeys';
import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { Separator } from '@/components/ui/separator';
@@ -86,6 +87,8 @@ function SidebarProvider({
React.useEffect(() => {
const handleKeyDown = (event: KeyboardEvent) => {
+ // In a text field the combination is the field's own: bold in the editor.
+ if (isTypingTarget(event.target)) return;
if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
event.preventDefault();
toggleSidebar();
diff --git a/apps/web/src/utils/hotkeys.ts b/apps/web/src/utils/hotkeys.ts
index f1474b73..4bd18b9b 100644
--- a/apps/web/src/utils/hotkeys.ts
+++ b/apps/web/src/utils/hotkeys.ts
@@ -57,7 +57,7 @@ export const HOTKEYS: HotkeyDef[] = [
id: 'sidebar.toggle',
group: 'general',
combo: 'mod+b',
- scope: 'global',
+ scope: 'app',
fixed: true,
},
{ id: 'issue.new', group: 'general', combo: 'n', scope: 'app' },