Skip to content

Commit

Permalink
! Fix searching (2nd time onward) in channel view broken (#3073)
Browse files Browse the repository at this point in the history
  • Loading branch information
PikachuEXE authored Jan 20, 2023
1 parent 28ee117 commit 590f3a6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/renderer/views/Channel/Channel.js
Original file line number Diff line number Diff line change
Expand Up @@ -676,12 +676,13 @@ export default defineComponent({
}
}

// `currentTabNode` can be `null` on 2nd+ search
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')
document.querySelector('.tabs > .tab[tabindex="0"]')?.setAttribute('tabindex', '-1')
newTabNode?.setAttribute('tabindex', '0')
currentTabNode.setAttribute('aria-selected', 'false')
currentTabNode?.setAttribute('aria-selected', 'false')
newTabNode?.setAttribute('aria-selected', 'true')
this.currentTab = tab
newTabNode?.focus({ focusVisible: true })
Expand Down

0 comments on commit 590f3a6

Please sign in to comment.