Skip to content

feat: add keyboard shortcut (Alt+Shift+C) to toggle Component Inspector#1090

Open
JamesGoslings wants to merge 1 commit intovuejs:mainfrom
JamesGoslings:feat/inspector-keyboard-shortcut
Open

feat: add keyboard shortcut (Alt+Shift+C) to toggle Component Inspector#1090
JamesGoslings wants to merge 1 commit intovuejs:mainfrom
JamesGoslings:feat/inspector-keyboard-shortcut

Conversation

@JamesGoslings
Copy link
Copy Markdown

Description

Closes #1058

This PR adds a keyboard shortcut Alt(Option)+Shift+C to toggle the Component Inspector, solving the pain point where clicking to activate the inspector causes pop-ups/overlays to close.

Motivation

Many UI libraries auto-close pop-ups on outside click. When using the Component Inspector to locate components inside these pop-ups, clicking activates the inspector but simultaneously closes the pop-up. A keyboard shortcut avoids this issue entirely.

Changes

File Change
packages/overlay/src/App.vue Add Alt+Shift+C keydown listener to call toggleVueInspector()
packages/client/src/App.vue Add the same shortcut in client iframe, triggering inspector via RPC
packages/vite/src/vite.ts Print shortcut hint in terminal when Vite dev server starts

How it works

  • The shortcut follows the same pattern as the existing Alt+Shift+D (toggle DevTools panel)
  • Alt maps to Option on macOS automatically (via e.altKey)
  • The shortcut only activates when vueInspectorSupported / vueInspectorDetected is true
  • Escape still works to exit the inspector (unchanged)

Terminal output

image

Test

image

Note

The issue author also mentioned customizable shortcuts. Since all existing shortcuts in the project (Alt+Shift+D, Escape) are hardcoded, adding customization would require architectural changes (e.g. passing user config through virtual modules to runtime). This can be addressed in a follow-up PR if needed.

Closes vuejs#1058

- Add Alt(Option)+Shift+C shortcut in overlay to toggle Component Inspector
- Add the same shortcut in client (DevTools iframe) via RPC
- Add terminal hint for the new shortcut when Vite dev server starts
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 22, 2026

Deploy Preview for vue-devtools-docs canceled.

Name Link
🔨 Latest commit 9bea558
🔍 Latest deploy log https://app.netlify.com/projects/vue-devtools-docs/deploys/69e89dbbd8d3c80008ed8bb7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature request] I hope to support using keyboard shortcuts to invoke the component locator

1 participant