Skip to content

Commit

Permalink
Controller navigation fixes, part 2
Browse files Browse the repository at this point in the history
This makes dialogs closeable with the back button again
  • Loading branch information
CommandMC committed Dec 1, 2024
1 parent 828571b commit 7918e00
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/frontend/helpers/gamepad.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,18 +291,18 @@ export const initGamepad = () => {
const el = currentElement()
if (!el) return false

return !!el.closest('.Dialog__element')
return !!el.closest('.MuiDialog-root')
}

function closeDialog() {
const el = currentElement()
if (!el) return false

const dialog = el.closest('.Dialog__element')
const dialog = el.closest('.MuiDialog-root')
if (!dialog) return false

const closeButton = dialog.querySelector<HTMLButtonElement>(
'.Dialog__CloseButton'
'[aria-label="close"]'
)
if (!closeButton) return false

Expand Down

0 comments on commit 7918e00

Please sign in to comment.