Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement concept of multiple focus targets #6095

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

frenzibyte
Copy link
Member

Preliminary step for removing the necessity of an input manager from DropdownSearchBar.

The end goal of this implementation is to make it possible for the dropdown search bar and menu to be focused together at once when the dropdown is open (in addition to Dropdown itself), to promote non-positional input to all those components.

After countless attempts at multiple approaches for this end goal, I've settled on this implementation as one with the least resistance when integrated with existing usages of focus in o!f and osu!.

The approach taken here revolves around a property in the Drawable class returning a list of drawables that should gain/lose focus alongside the main drawable providing them (in my case, the main drawable class would be Dropdown, and it would override the property to return both Menu and DropdownHeader->DropdownSearchBar->TextBox).

Test coverage made here is pretty basic (showcasing how the feature can be utilised), but I aim to add more cases if the approach is agreed upon.

@peppy peppy self-requested a review April 19, 2024 06:42
@smoogipoo
Copy link
Contributor

smoogipoo commented May 8, 2024

My immediate concern with this is that it's a very specific way of handling this one case. But as soon as you have multiple focus in a case that's slightly less contained within one component -- suppose some FocusedOverlayContainer scenario -- it becomes annoying to handle.

I'm going to do my own investigations into this while keeping this PR in the back pocket. Ideally all of these scenarios would be something akin to nested focus. There's a few things I don't understand about how focus currently works (I think specifically related to the dropdown+header component), so it'll be a good exercise for me to at least understand why things are even working as they are.

I'm not sold on the idea of explicit multiple focus targets right now.

@peppy
Copy link
Sponsor Member

peppy commented May 9, 2024

I'm not sure if I had a dangling review that I lost, or I mentioned my thoughts somewhere else like discord but I came to roughly the same conclusion (aka. i hope we can avoid this).

I'd definitely agree on the direction of attempting to fix the underlying issue without this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants