Heroic-Games-Launcher / HeroicGamesLauncher

A games launcher for GOG, Amazon and Epic Games for Linux, Windows and macOS.
https://heroicgameslauncher.com
GNU General Public License v3.0
7.94k stars 421 forks source link

When hiding a game in the Library, focus the next/previous game #1910

Open arielj opened 1 year ago

arielj commented 1 year ago

Problem description

When hiding a game using a controller, the focus is lost and you have to move back from the corners to the library to get back to where you were focusing inside the library.

Feature description

When a game is hid, the next game card should be focused. If no next game card, then the previous game card should be focus. If no previous game card either, then the current behavior of losing focus is fine.

Alternatives

Keep the current behavior, is not critical, just an annoyance.

Additional information

No response

arielj commented 1 year ago

~I'm removing the good first issue label, handling controller focus doesn't seem simple (not sure if it's even possible, the spatial navigation feature is undocumented and it has no methods in the browser's JavaScript API)~

EDIT: well I was doing something wrong with my tests I guess, it seems to be as simple as calling .focus() on the element we want to focus xD