From 505181dbc92b892bfc4612f28992ba613d13d26c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=BDan=20Anderle?= Date: Mon, 2 Dec 2024 10:32:51 +0100 Subject: [PATCH] Fix storing recent search when using keyboard (#454) Initially I implemented a custom event to achieve this, but in the end, simply using `click` event seemed like a much cleaner solution. Closes #399 --- src/search.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/search.js b/src/search.js index a4fd566..189e9a1 100644 --- a/src/search.js +++ b/src/search.js @@ -530,7 +530,7 @@ export class SearchElement extends LitElement { const selected = this.renderRoot.querySelector("a.hit.active"); // if an item is selected, then redirect to its link if (selected !== null) { - window.location.href = selected.href; + selected.click(); } }