website: fix search page turning error. #32

This commit is contained in:
jaywcjlove 2022-11-22 09:35:17 +08:00
parent 8a5153365d
commit 13a6f7f4d5

View File

@ -78,7 +78,8 @@ document.addEventListener('keydown', (ev) => {
searchBox.classList.contains('show') ? hideSearch() : showSearch();
}
if (ev.key.toLocaleLowerCase() === 'enter') {
window.location.href = getDocUrl(activeMenu.path)
const url = activeMenu.path || activeMenu?.item.path;
window.location.href = getDocUrl(url);
}
if (ev.key.toLocaleLowerCase() === 'arrowdown') {
activeAnchorElm('down')