From 1c55a8b0e7f3f1bd5a1f1d9547294f21f1cac3f3 Mon Sep 17 00:00:00 2001 From: PikachuEXE Date: Sat, 14 Jan 2023 14:09:02 +0800 Subject: [PATCH] ! Fix searching in channel view broken --- src/renderer/views/Channel/Channel.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/renderer/views/Channel/Channel.js b/src/renderer/views/Channel/Channel.js index f5a668f76baa5..c740e2e28f1c7 100644 --- a/src/renderer/views/Channel/Channel.js +++ b/src/renderer/views/Channel/Channel.js @@ -682,13 +682,14 @@ export default Vue.extend({ } const currentTabNode = document.querySelector('.tabs > .tab[aria-selected="true"]') + // `newTabNode` can be `null` when `tab` === "search" const newTabNode = document.getElementById(`${tab}Tab`) document.querySelector('.tabs > .tab[tabindex="0"]').setAttribute('tabindex', '-1') - newTabNode.setAttribute('tabindex', '0') + newTabNode?.setAttribute('tabindex', '0') currentTabNode.setAttribute('aria-selected', 'false') - newTabNode.setAttribute('aria-selected', 'true') + newTabNode?.setAttribute('aria-selected', 'true') this.currentTab = tab - newTabNode.focus({ focusVisible: true }) + newTabNode?.focus({ focusVisible: true }) }, newSearch: function (query) {