website: fix search page turning error. #32 13a6f7f4d5

This commit is contained in:
jaywcjlove
2022-11-22 01:36:27 +00:00
parent 8442c961fd
commit c1c72c9bd5
2 changed files with 3 additions and 2 deletions

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')