From 135811201a999ec21d60a2380ddd870311679704 Mon Sep 17 00:00:00 2001 From: leo60228 Date: Sat, 14 Sep 2024 18:11:52 -0400 Subject: cleaner optional chaining --- src/static/js/client/sidebar-search.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/static/js/client/sidebar-search.js b/src/static/js/client/sidebar-search.js index 48bc8d08..2d346b41 100644 --- a/src/static/js/client/sidebar-search.js +++ b/src/static/js/client/sidebar-search.js @@ -349,7 +349,7 @@ export function addPageListeners() { info.searchInput.addEventListener('keydown', domEvent => { if (domEvent.key === 'ArrowDown') { const elem = info.results.firstChild; - if (elem?.classList?.contains?.('wiki-search-result')) { + if (elem?.classList.contains('wiki-search-result')) { domEvent.preventDefault(); elem.focus({focusVisible: true}); } -- cgit 1.3.0-6-gf8a5