From f5c75763bfed4e24271370e34c155c878c6fafb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radek=20=C5=A0er=C3=BD?= Date: Thu, 29 Aug 2024 10:39:06 +0200 Subject: [PATCH] fix: Use `click()` on `Enter` key for suggestion handling When using the `Enter` key to activate the selected suggestion result, we now use the `click()` method instead of replacing the location. This allows the application to use AJAX to process the suggestion result. Previously, the Enter key would cause navigation to the page instead of an AJAX request. --- src/classes/Suggest.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/classes/Suggest.ts b/src/classes/Suggest.ts index eea07cd..cfa4a16 100644 --- a/src/classes/Suggest.ts +++ b/src/classes/Suggest.ts @@ -191,7 +191,7 @@ export class Suggest { event.preventDefault() event.stopPropagation() - location.href = activeAnchor.href + activeAnchor.click() } break }