Skip to content

Commit

Permalink
Support typing '/' to search
Browse files Browse the repository at this point in the history
  • Loading branch information
mu001999 authored Apr 30, 2024
1 parent f6eaee8 commit c00d21d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions static/keyboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
switch (getKey(ev)) {
case "s":
case "S":
case "/":
ev.preventDefault();
focusSearchInput();
break;
Expand Down
2 changes: 1 addition & 1 deletion templates/core/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ <h1 class="brand">{{ "cubes" | fas }} Docs.rs</h1>
<form action="/releases/search" method="GET" class="landing-search-form">
<div>
<input class="search-input" id="search" name="query" type="text" aria-label="Find crate by search query"
placeholder="Click or press 'S' to search" autofocus>
placeholder="Type 'S' or '/' to search" autofocus>
</div>

<div class="buttons">
Expand Down

0 comments on commit c00d21d

Please sign in to comment.