diff --git a/static/js/src/cve/cve.js b/static/js/src/cve/cve.js index 8df30a93a7b..d10fc4920e0 100644 --- a/static/js/src/cve/cve.js +++ b/static/js/src/cve/cve.js @@ -8,6 +8,7 @@ import { } from "./cve-search.js"; const searchInput = document.querySelector("#q"); +const searchForm = document.querySelector("#searchForm"); function handleCveIdInput(value) { const packageInput = document.querySelector("#package"); @@ -63,7 +64,11 @@ function handleCveIdInput(value) { handleCveIdInput(searchInput.value); function handleSearchInput(event) { - handleCveIdInput(event.target.value); + if (event.key === "Enter") { + searchForm.submit(); + } else { + handleCveIdInput(event.target.value); + } } searchInput.addEventListener("keyup", handleSearchInput); diff --git a/templates/security/cve/index.html b/templates/security/cve/index.html index 19bd850bbfb..e1770baacc8 100644 --- a/templates/security/cve/index.html +++ b/templates/security/cve/index.html @@ -32,7 +32,7 @@

CVE reports

Search

{% endif %} -
+