diff options
| author | AAGaming <aa@mail.catvibers.me> | 2022-10-01 23:10:25 -0400 |
|---|---|---|
| committer | AAGaming <aa@mail.catvibers.me> | 2022-10-01 23:10:25 -0400 |
| commit | 617916e8e5a8840f44309b4803f86f37180ddef1 (patch) | |
| tree | 6dc2e3fda6c3263b41622c3bbf2f99751b892350 /frontend | |
| parent | 6c4a4d0a4432973557c02185cd7d4803bb5ad674 (diff) | |
| download | decky-loader-617916e8e5a8840f44309b4803f86f37180ddef1.tar.gz decky-loader-617916e8e5a8840f44309b4803f86f37180ddef1.zip | |
actually fix focus issue on startup
Diffstat (limited to 'frontend')
| -rw-r--r-- | frontend/src/toaster.tsx | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/frontend/src/toaster.tsx b/frontend/src/toaster.tsx index 3fe2e87e..2103da5f 100644 --- a/frontend/src/toaster.tsx +++ b/frontend/src/toaster.tsx @@ -46,15 +46,27 @@ class Toaster extends Logger { return false; }); - const focusWorkaroundPatch = replacePatch(focusManager.prototype, 'BFocusWithin', function () { + const overrideFocus = function () { // @ts-ignore - if (this.m_node?.m_element && this.m_node?.m_element.classList.contains(staticClasses.TabGroupPanel)) { + self.debug(this.m_node.m_element); + // @ts-ignore + const classList = this.m_node?.m_element.classList; + if ( + // @ts-ignore + (this.m_node?.m_element && classList.contains(staticClasses.TabGroupPanel)) || + classList.contains('FriendsListTab') || + classList.contains('FriendsTabList') || + classList.contains('FriendsListAndChatsSteamDeck') + ) { self.debug('Intercepted friends re-focus'); return true; } return callOriginal; - }); + }; + + const focusWorkaroundPatch = replacePatch(focusManager.prototype, 'TakeFocus', overrideFocus); + while (true) { instance = findInReactTree( (document.getElementById('root') as any)._reactRootContainer._internalRoot.current, |
