Skip to content

Commit 5c7a1b5

Browse files
committed
Update console-sheet.js
1 parent 0ab9247 commit 5c7a1b5

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

live-view/extensions/mobile-console/console-sheet.js

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -680,19 +680,26 @@ class ConsoleSheet {
680680

681681
});
682682

683-
// fix soft-hiding keyboard on Android
684683
navigator.virtualKeyboard.addEventListener('geometrychange', () => {
685684

686-
const keyboardHeight = navigator.virtualKeyboard.boundingRect.height;
685+
let keyboardHeight = navigator.virtualKeyboard.boundingRect.height;
687686

688687
body.style.setProperty('--keyboard-height', keyboardHeight + 'px');
689688

690-
if (document.activeElement === input &&
691-
keyboardHeight === 0) {
689+
690+
// prevent soft-hiding keyboard on Android
691+
onNextFrame(() => {
692692

693-
input.blur();
694-
695-
}
693+
keyboardHeight = navigator.virtualKeyboard.boundingRect.height;
694+
695+
if (document.activeElement === input &&
696+
keyboardHeight === 0) {
697+
698+
input.blur();
699+
700+
}
701+
702+
});
696703

697704
});
698705

0 commit comments

Comments
 (0)