From e64dbcd31ea1aa50d72bac9cec958e0159da6226 Mon Sep 17 00:00:00 2001 From: Arash <38922203+arashsheyda@users.noreply.github.com> Date: Tue, 2 May 2023 17:16:38 +0300 Subject: [PATCH] fix: fix shortcut to togglePanel (#212) --- packages/devtools/client/app.vue | 2 +- packages/devtools/src/runtime/plugins/devtools.client.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/devtools/client/app.vue b/packages/devtools/client/app.vue index c02ed5c8b..bc8d6d7a4 100644 --- a/packages/devtools/client/app.vue +++ b/packages/devtools/client/app.vue @@ -32,7 +32,7 @@ const route = useRoute() const isUtilityView = computed(() => route.path.startsWith('/__')) const waiting = computed(() => !client.value && !showConnectionWarning.value) -addEventListener('keypress', (e) => { +addEventListener('keydown', (e) => { if (e.code === 'KeyD' && e.altKey) { client.value?.closeDevTools() e.preventDefault() diff --git a/packages/devtools/src/runtime/plugins/devtools.client.ts b/packages/devtools/src/runtime/plugins/devtools.client.ts index 499543ed9..cc76bbd9d 100644 --- a/packages/devtools/src/runtime/plugins/devtools.client.ts +++ b/packages/devtools/src/runtime/plugins/devtools.client.ts @@ -54,7 +54,7 @@ export default defineNuxtPlugin((nuxt: Nuxt) => { document.body.appendChild(holder) // Shortcut to toggle devtools - addEventListener('keypress', (e) => { + addEventListener('keydown', (e) => { if (e.code === 'KeyD' && e.altKey && e.shiftKey) togglePanel() })