Skip to content

Commit

Permalink
feat: do not close search dialog on meta+click
Browse files Browse the repository at this point in the history
  • Loading branch information
tmm committed Jan 18, 2024
1 parent 10361b0 commit 2814abe
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/app/components/SearchDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,11 @@ export function SearchDialog(props: { open: boolean; onClose(): void }) {
>
<Link
to={result.href}
onClick={() => props.onClose()}
onClick={(event) => {
// Don't close the dialog if the user is opening the link in a new tab.
if (event.metaKey) return
props.onClose()
}}
onMouseEnter={() => !disableMouseOver && setSelectedIndex(index)}
onFocus={() => setSelectedIndex(index)}
>
Expand Down

0 comments on commit 2814abe

Please sign in to comment.