Skip to content

Commit

Permalink
fix: Enter key does not submit form, now triggers the sort order whic…
Browse files Browse the repository at this point in the history
…h performs the submit (#369)
  • Loading branch information
killij authored Jan 12, 2024
1 parent 942bbc7 commit 9ccb0d9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,5 @@
</div>

@section Scripts {
<script src="~/javascript/search-sort.js" asp-append-version="true"></script>
<script src="~/javascript/search.js" asp-append-version="true"></script>
}
9 changes: 9 additions & 0 deletions Childrens-Social-Care-CPD/wwwroot/javascript/search.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
document.addEventListener("DOMContentLoaded", function () {
const input = document.getElementById('searchTermInput')
input.addEventListener("keydown", (e) => {
if (e.key === "Enter") {
document.getElementById('sortOrder').value = 2
return false
}
})
})

0 comments on commit 9ccb0d9

Please sign in to comment.