Skip to content

Commit

Permalink
Fix dropdowns showing keyboard on mobile even harder
Browse files Browse the repository at this point in the history
  • Loading branch information
bdach committed Dec 18, 2023
1 parent f949384 commit 378784d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions osu.Framework/Graphics/UserInterface/DropdownSearchBar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,17 @@ protected override void LoadComplete()
public void ObtainFocus()
{
// On mobile platforms, let's not make the keyboard popup unless the dropdown is intentionally searchable.
// Unfortunately it is not enough to just early-return here,
// as even despite that the text box will receive focus via the text box input manager;
// it is necessary to cut off the text box input manager from parent input entirely.
// TODO: preferably figure out a better way to do this.
bool willShowOverlappingKeyboard = host?.OnScreenKeyboardOverlapsGameWindow == true;

if (willShowOverlappingKeyboard && !AlwaysDisplayOnFocus)
{
textBoxInputManager.UseParentInput = false;
return;
}

textBoxInputManager.ChangeFocus(textBox);
obtainedFocus = true;
Expand Down

0 comments on commit 378784d

Please sign in to comment.