mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
feat: auto focus search bar when sidebar is shown
This commit is contained in:
@ -32,6 +32,10 @@ export const toggleHomeSidebar = (show?: boolean) => {
|
||||
if (show) {
|
||||
sidebarEl.classList.add("show");
|
||||
maskEl.classList.add("show");
|
||||
|
||||
// auto focus search bar when sidebar is shown
|
||||
const inputEl = sidebarEl.querySelector("#mobile-search-bar") as HTMLInputElement;
|
||||
inputEl?.focus();
|
||||
} else {
|
||||
sidebarEl.classList.remove("show");
|
||||
maskEl.classList.remove("show");
|
||||
|
Reference in New Issue
Block a user