yairm210 / Unciv

Open-source Android/Desktop remake of Civ V
Mozilla Public License 2.0
8.53k stars 1.58k forks source link

Bug: Mod sort text field hard to use on Android in some orientations. #12331

Open The-Talik opened 3 weeks ago

The-Talik commented 3 weeks ago

Is there an existing issue for this?

Game Version

4.13.18

Describe the bug

So, this one took me a while to realize what was happening, but if my phone is what I consider upside-down-landscape, the mod filter text field operates in an intuitive way -- I get a keyboard at the bottom of my screen, and the text gets added to the input field. If my phone is right-side-up-landscape, then when I click the filter text, I get a popup "Enter search text". I can enter the text, but clicking OK doesn't update the text in the filter input, making it impossible to use. image image

Expected behavior would be identical behavior no matter the phone orientation.

Steps to Reproduce

On mobile, go to mod page. Click filter. Turn phone upside down, click filter again.

Screenshots

No response

Link to save file

No response

Operating System

Android

Additional Information

No response

yairm210 commented 3 weeks ago

@SomeTroglodyte This looks like your expertise

SomeTroglodyte commented 3 weeks ago

Not really. That textbox was originally by - what was the name - Timo. I only refactored code structure afterwards. The idea "scroll the field into view, because popping up the soft keyboard might have hidden it, but if you can't, then show an extra popup instead - that was Azzurite aka Timo T. Oh - I even mentioned that I tried to provoke this box when testing #11705 but couldn't trigger it... I mean, "turn phone upside down", that requires a little creativity.

Here, there's two "failures": recognizing that the field is already in view, and transmitting content back to the underlying field on "OK". Sounds debuggable if "upside down" is a reliable trigger - but I haven't got the energy atm. Back then I briefly considered simply disabling that popup - comment out private inner class TextfieldPopup and line 88 where it is instantiated - because I couldn't get it to kick in, but decided against as I don't know about parts of the multiplayer UI potentially depending on it.