Skip to content

Commit

Permalink
Merge pull request canonical#13188 from Harsh0707005/Harsh0707005-#13157
Browse files Browse the repository at this point in the history
  • Loading branch information
mtruj013 authored Oct 16, 2023
2 parents e6b6007 + b47ff87 commit eb87111
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion static/js/src/cve/cve.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion templates/security/cve/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ <h1>CVE reports</h1>
<h2>Search</h2>
{% endif %}
</div>
<form>
<form id = "searchForm">
<div class="row">
<div class="col-6">
<label for="q">CVE ID or description contains:</label>
Expand Down

0 comments on commit eb87111

Please sign in to comment.