From c00d21d86c20bab5ccd47e8b8c8da53652db54d7 Mon Sep 17 00:00:00 2001 From: r01and Date: Tue, 30 Apr 2024 16:37:48 +0800 Subject: [PATCH] Support typing '/' to search --- static/keyboard.js | 1 + templates/core/home.html | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/static/keyboard.js b/static/keyboard.js index 92a068a5d..9ad55e930 100644 --- a/static/keyboard.js +++ b/static/keyboard.js @@ -102,6 +102,7 @@ switch (getKey(ev)) { case "s": case "S": + case "/": ev.preventDefault(); focusSearchInput(); break; diff --git a/templates/core/home.html b/templates/core/home.html index 07c4380ce..740548194 100644 --- a/templates/core/home.html +++ b/templates/core/home.html @@ -13,7 +13,7 @@

{{ "cubes" | fas }} Docs.rs

+ placeholder="Type 'S' or '/' to search" autofocus>