search key nav fixes
All checks were successful
Build Roam Site / build (push) Successful in 32s

This commit is contained in:
2026-05-14 14:51:09 +01:00
parent 74449c345a
commit ccdd229a7d
332 changed files with 407 additions and 149 deletions

View File

@@ -124,7 +124,11 @@ function initSidebarRail() {
btn.addEventListener('click', () => {
if (action === 'search') {
document.getElementById('search-box')?.focus();
if (typeof window.openSearchModal === 'function') {
window.openSearchModal();
} else {
document.getElementById('search-box')?.focus();
}
return;
}
const isExpanded = sidebar.classList.contains('expanded');
@@ -882,6 +886,7 @@ function hookSearchResults() {
e.stopPropagation();
resultsBox.innerHTML = '';
if (searchBox) searchBox.value = '';
window.closeSearchModal?.();
let resolved;
try { resolved = new URL(url, location.href); } catch { return; }
@@ -907,6 +912,7 @@ function hookSearchResults() {
if (!url) return;
resultsBox.innerHTML = '';
searchBox.value = '';
window.closeSearchModal?.();
let resolved;
try { resolved = new URL(url, location.href); } catch { return; }
openNote(resolved.pathname, active.textContent.trim(), resolved.hash);