[1.30.4] Back is pressed instead of keyboard hidden if it's performed too quickly
Describe the bug
Let's open a screen with EditText, which is focused automatically. Then, instantly hide the on-screen keyboard with hideKeyboard command. Usually, it works fine - we end up with focused EditText which we can feed with text and with complete visibility of the rest of the screen. However, sometimes hideKeyboard performs back before the keyboard is fully visible which navigates the app to the previous screen, so it's kind of a race condition.
Expected behavior
hideKeyboard should ensure that the on-screen keyboard is visible before trying to hide it to reduce flakiness.
Environment information (please complete the following information):
- Maestro version: [1.30.4]
- Platform: [Android 13]
- Framework: [Native Android]
- Device model and OS version: Android Emulator based on Android 13
- Host: Mac M1
Did you find any alternative solution? I am also facing this issue. :(
This is still an issue right? Think I'm running into it.
@arapocket Could be, it's not one I've looked into.
In the meantime, some workaround ideas:
- add a
waitForAnimationToEndbeforehideKeyboard - tap something non-interactive instead of using
hideKeyboard, like a header. That would dismiss the keyboard without risking unexpected navigation.