Skip to content

Commit 8015f57

Browse files
committed
Set search query value to search-form
1 parent 11906f9 commit 8015f57

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/assets/js/search.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
$(() => {
22
const searchForm = document.getElementById("search-form")
3+
const searchValue = (new URLSearchParams(location.search)).get("q")
4+
5+
if (searchValue) {
6+
searchForm.value = searchValue
7+
}
38

49
addEventListener("keydown", (e) => {
510
switch (e.key) {

0 commit comments

Comments
 (0)