Skip to content

Commit

Permalink
website: make the navbar use 'input' event rather than 'keyup'
Browse files Browse the repository at this point in the history
This is so other forms of input work, rather than just keyboard-like
  • Loading branch information
Wessie committed Feb 20, 2024
1 parent fba169f commit e29e95f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion assets/js/radio.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ function clearNavbarSearchValue(event) {
document.getElementById("content").addEventListener("click", (e) => {
if (!parent.contains(e.explicitOriginalTarget)) {
originalTarget.value = "";
htmx.trigger(originalTarget, "keyup");
htmx.trigger(originalTarget, "input");
document.body.removeEventListener("click", this, true);
}
})
Expand Down
2 changes: 1 addition & 1 deletion templates/default/partials/navbar.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</div>
<div class="navbar-end is-hidden-touch">
<form class="is-flex is-width-90 my-auto" method="GET" action="/search" accept-charset="UTF-8">
<input id="navbarinput" hx-push-url="false" hx-get="/v1/search" hx-trigger="keyup changed delay:250ms" hx-target="#search-bar" class="input" type="text" name="q" placeholder="Request Song" role="search" onblur=clearNavbarSearchValue(event)>
<input id="navbarinput" hx-push-url="false" hx-get="/v1/search" hx-trigger="input changed delay:250ms" hx-target="#search-bar" class="input" type="text" name="q" placeholder="Request Song" role="search" onblur=clearNavbarSearchValue(event)>
</form>
<div id="search-bar" style="position: absolute;"></div>
</div>
Expand Down

0 comments on commit e29e95f

Please sign in to comment.