diff --git a/apps/www/.vitepress/theme/layout/MainLayout.vue b/apps/www/.vitepress/theme/layout/MainLayout.vue
index 9a0b7a0c..23bc4121 100644
--- a/apps/www/.vitepress/theme/layout/MainLayout.vue
+++ b/apps/www/.vitepress/theme/layout/MainLayout.vue
@@ -49,7 +49,13 @@ const links = [
]
const isOpen = ref(false)
-const { Meta_K, Ctrl_K } = useMagicKeys()
+const { Meta_K, Ctrl_K } = useMagicKeys({
+ passive: false,
+ onEventFired(e) {
+ if (e.key === 'k' && (e.metaKey || e.ctrlKey))
+ e.preventDefault()
+ },
+})
watch([Meta_K, Ctrl_K], (v) => {
if (v[0] || v[1])
diff --git a/apps/www/src/lib/registry/default/example/CommandDialogDemo.vue b/apps/www/src/lib/registry/default/example/CommandDialogDemo.vue
index 9f18c79a..ddc3f24c 100644
--- a/apps/www/src/lib/registry/default/example/CommandDialogDemo.vue
+++ b/apps/www/src/lib/registry/default/example/CommandDialogDemo.vue
@@ -14,17 +14,22 @@ import {
const open = ref(false)
-const keys = useMagicKeys()
-const CmdJ = keys['Cmd+J']
+const { Meta_J, Ctrl_J } = useMagicKeys({
+ passive: false,
+ onEventFired(e) {
+ if (e.key === 'j' && (e.metaKey || e.ctrlKey))
+ e.preventDefault()
+ },
+})
+
+watch([Meta_J, Ctrl_J], (v) => {
+ if (v[0] || v[1])
+ handleOpenChange()
+})
function handleOpenChange() {
open.value = !open.value
}
-
-watch(CmdJ, (v) => {
- if (v)
- handleOpenChange()
-})
@@ -37,7 +42,7 @@ watch(CmdJ, (v) => {
⌘J
-
+
No results found.
diff --git a/apps/www/src/lib/registry/new-york/example/CommandDialogDemo.vue b/apps/www/src/lib/registry/new-york/example/CommandDialogDemo.vue
index e8b4e11a..f5e1beb1 100644
--- a/apps/www/src/lib/registry/new-york/example/CommandDialogDemo.vue
+++ b/apps/www/src/lib/registry/new-york/example/CommandDialogDemo.vue
@@ -14,17 +14,22 @@ import {
const open = ref(false)
-const keys = useMagicKeys()
-const CmdJ = keys['Cmd+J']
+const { Meta_J, Ctrl_J } = useMagicKeys({
+ passive: false,
+ onEventFired(e) {
+ if (e.key === 'j' && (e.metaKey || e.ctrlKey))
+ e.preventDefault()
+ },
+})
+
+watch([Meta_J, Ctrl_J], (v) => {
+ if (v[0] || v[1])
+ handleOpenChange()
+})
function handleOpenChange() {
open.value = !open.value
}
-
-watch(CmdJ, (v) => {
- if (v)
- handleOpenChange()
-})
@@ -37,7 +42,7 @@ watch(CmdJ, (v) => {
⌘J
-
+
No results found.
diff --git a/apps/www/src/public/registry/styles/default/dialog.json b/apps/www/src/public/registry/styles/default/dialog.json
index c9f9387f..76ff177f 100644
--- a/apps/www/src/public/registry/styles/default/dialog.json
+++ b/apps/www/src/public/registry/styles/default/dialog.json
@@ -7,7 +7,7 @@
"files": [
{
"name": "Dialog.vue",
- "content": "\n\n\n \n \n \n\n"
+ "content": "\n\n\n \n \n \n\n"
},
{
"name": "DialogClose.vue",
diff --git a/apps/www/src/public/registry/styles/default/input.json b/apps/www/src/public/registry/styles/default/input.json
index 4290905d..ae1e2ad9 100644
--- a/apps/www/src/public/registry/styles/default/input.json
+++ b/apps/www/src/public/registry/styles/default/input.json
@@ -9,7 +9,7 @@
"files": [
{
"name": "Input.vue",
- "content": "\n\n\n \n\n"
+ "content": "\n\n\n \n\n"
},
{
"name": "index.ts",
diff --git a/apps/www/src/public/registry/styles/new-york/dialog.json b/apps/www/src/public/registry/styles/new-york/dialog.json
index c7aade14..cb379fd1 100644
--- a/apps/www/src/public/registry/styles/new-york/dialog.json
+++ b/apps/www/src/public/registry/styles/new-york/dialog.json
@@ -7,7 +7,7 @@
"files": [
{
"name": "Dialog.vue",
- "content": "\n\n\n \n \n \n\n"
+ "content": "\n\n\n \n \n \n\n"
},
{
"name": "DialogClose.vue",
diff --git a/apps/www/src/public/registry/styles/new-york/input.json b/apps/www/src/public/registry/styles/new-york/input.json
index 26a6a806..fb565151 100644
--- a/apps/www/src/public/registry/styles/new-york/input.json
+++ b/apps/www/src/public/registry/styles/new-york/input.json
@@ -9,7 +9,7 @@
"files": [
{
"name": "Input.vue",
- "content": "\n\n\n \n\n"
+ "content": "\n\n\n \n\n"
},
{
"name": "index.ts",