Skip to content

Commit

Permalink
fix: Add retry for keyboard hide (#947)
Browse files Browse the repository at this point in the history
  • Loading branch information
mykola-mokhnach authored Jul 3, 2024
1 parent d820fe5 commit 26ef625
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/commands/device/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
pushSettingsApp,
} from './utils';
import {adjustTimeZone} from '../time';
import { retryInterval } from 'asyncbox';

/**
* @this {AndroidDriver}
Expand Down Expand Up @@ -247,7 +248,10 @@ export async function initDevice() {
}
setupPromises.push((async () => {
if (hideKeyboard) {
await hideKeyboardCompletely.bind(this)();
// Sometimes we have a race condition when Android
// does not register input services soon enough
// after Settings app is installed
await retryInterval(3, 500, async () => await hideKeyboardCompletely.bind(this)());
} else if (hideKeyboard === false) {
await this.adb.shell(['ime', 'reset']);
}
Expand Down

0 comments on commit 26ef625

Please sign in to comment.