Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.

fix: Pressing enter when searching no longer goes to about:blank #504

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/components/Hero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ const Hero = () => {
setFocus(false);
}, 200)}
onKeyUp={(event: React.KeyboardEvent) => {
if (event.key === "Enter") {
// if no result is selected yet, then the comboBoxSelection will be empty, which will trigger a `about:blank` page to open
if (event.key === "Enter" && comboBoxSelection !== "") {
window.open(comboBoxSelection, "_blank", "noreferrer");
}
}}
Expand Down
Loading