Scope to repoSidebar in case more tab bars added in future

This commit is contained in:
tidy-dev 2023-09-13 16:29:44 -04:00
parent 72a10a223b
commit bbfa90c37b

View file

@ -2752,8 +2752,10 @@ export class AppStore extends TypedBaseStore<IAppState> {
}
if (forceButtonFocus) {
const buttons = document.getElementsByClassName('tab-bar-item selected')
const button = buttons[0] as HTMLButtonElement
const repoSideBar = document.getElementById('repository-sidebar')
const button = repoSideBar?.querySelector(
'.tab-bar-item.selected'
) as HTMLButtonElement
button?.focus()
}
}