mirror of
https://github.com/grafana/grafana.git
synced 2026-02-03 20:49:50 -05:00
Revert "KBARResults: Add Cmd+Enter/Ctrl+Enter to open links in new tab" (#107933)
Revert "KBARResults: Add Cmd+Enter/Ctrl+Enter to open links in new tab (#107537)"
This reverts commit a2a28b207c.
This commit is contained in:
parent
a01b4c31a1
commit
b1c50d6354
1 changed files with 1 additions and 12 deletions
|
|
@ -71,18 +71,7 @@ export const KBarResults = (props: KBarResultsProps) => {
|
|||
}
|
||||
return nextIndex;
|
||||
});
|
||||
} else if (event.key === 'Enter' && (event.metaKey || event.ctrlKey)) {
|
||||
// Cmd+Enter (Mac) or Ctrl+Enter (Windows/Linux) - open in new tab
|
||||
event.preventDefault();
|
||||
|
||||
if (activeRef.current instanceof HTMLAnchorElement) {
|
||||
window.open(activeRef.current.href, '_blank', 'noopener,noreferrer');
|
||||
query.toggle();
|
||||
} else {
|
||||
// For action-based items (rendered as <div> tags), execute normally
|
||||
activeRef.current?.click();
|
||||
}
|
||||
} else if (event.key === 'Enter' && !event.metaKey && !event.ctrlKey) {
|
||||
} else if (event.key === 'Enter' && !event.metaKey) {
|
||||
event.preventDefault();
|
||||
// storing the active dom element in a ref prevents us from
|
||||
// having to calculate the current action to perform based
|
||||
|
|
|
|||
Loading…
Reference in a new issue