Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

fix(cmdk): firefox cmk+k focusing address bar

Greg Richardson44ac97472835
diff --git a/packages/ui/src/components/Command/CommandMenuProvider.tsx b/packages/ui/src/components/Command/CommandMenuProvider.tsx
index 3f94ba1e78d..acfb2ac7010 100644
--- a/packages/ui/src/components/Command/CommandMenuProvider.tsx
+++ b/packages/ui/src/components/Command/CommandMenuProvider.tsx
@@ -105,6 +105,9 @@ function useKeyboardEvents({
case 'k':
case '/':
if (event.metaKey || event.ctrlKey) {
+ // Some browsers (ie. firefox) will focus the address bar by default
+ event.preventDefault()
+
setIsOpen(true)
}
return