Line

You are reading the unreleased docs (next). See latest (v0.9)

ui/client/features/command-palette/services/PaletteBrowser

Cockpit client (features), next. Source: ui/client/features/command-palette/services/PaletteBrowser.ts.

Functions#

rememberFocus()#

rememberFocus(): () => void

Defined in: ui/client/features/command-palette/services/PaletteBrowser.ts:18

Remembers the focused element and returns a function that puts focus back on it.

Returns#

() => void


subscribePaletteShortcut()#

subscribePaletteShortcut(onToggle): () => void

Defined in: ui/client/features/command-palette/services/PaletteBrowser.ts:6

Calls onToggle on Ctrl/Cmd+K (commands) or Ctrl/Cmd+P anywhere (capture phase, so editors cannot swallow it and the browser's print dialog never opens). Returns an unsubscribe.

Parameters#

onToggle

() => void

Returns#

() => void