diff --git a/public/app/features/commandPalette/KBarResults.tsx b/public/app/features/commandPalette/KBarResults.tsx index 2eb8a5aecf7..020c57ec42f 100644 --- a/public/app/features/commandPalette/KBarResults.tsx +++ b/public/app/features/commandPalette/KBarResults.tsx @@ -121,6 +121,10 @@ export const KBarResults = (props: KBarResultsProps) => { const url = (item as ActionImpl & { url?: string }).url; if (item.command) { + if (url) { + // If the item also has a url we should block navigation. + ev.preventDefault(); + } item.command.perform(item); // TODO: ideally the perform method would return some marker or we would have something like preventDefault() if (!item.id.startsWith('scopes/') || item.id === 'scopes/apply') { diff --git a/public/app/features/commandPalette/actions/useExtensionActions.ts b/public/app/features/commandPalette/actions/useExtensionActions.ts index 1050fb0deb9..112bdc5ab0d 100644 --- a/public/app/features/commandPalette/actions/useExtensionActions.ts +++ b/public/app/features/commandPalette/actions/useExtensionActions.ts @@ -22,8 +22,8 @@ export default function useExtensionActions(): CommandPaletteAction[] { priority: EXTENSIONS_PRIORITY, id: link.id, name: link.title, - target: link.path, perform: () => link.onClick && link.onClick(), + url: link.path, })); }, [links]); }