Skip to content

Commit

Permalink
fix: Use click() on Enter key for suggestion handling
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
zipper committed Aug 29, 2024
1 parent 608b503 commit f5c7576
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/classes/Suggest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ export class Suggest {
event.preventDefault()
event.stopPropagation()

location.href = activeAnchor.href
activeAnchor.click()
}
break
}
Expand Down

0 comments on commit f5c7576

Please sign in to comment.