When the PWA Display is set to fullscreen, the API doesn't allow the viewport to adjust upon input events, so the virtual keyboard will always overlay the app. For more details see Progressive Web-App Soft-Keyboard and Nav Bar overlaps in Fullscreen
Simplest solution is to set it to standalone. Otherwise:
One generic CSS workaround you can do to enforce viewport updates is use :focus-within, for example (note, not broadly tested):
@media only screen and (orientation: landscape) and (hover: none) {
body:focus-within,
body:focus-within .an-absolutely-positioned-input-ancestor {
max-height: 53vh;
overflow: auto;
}
}
A more specific workaround we used was to use Javascript to add an input_focus class to the body tag for specific applicable form elements only on the focus event, then select that with CSS and style that element (absolute/fixed) to float above the keyboard.
Brief example of this with jQuery:
JS
var inputs = jQuery('input[type="text"]').add('textarea');
inputs.each((index, input) => {
input.on('focus', e => {
jQuery('body').addClass('input_focus');
}).on('blur', e => {
jQuery('body').removeClass('input_focus');
});
}
CSS
body.input_focus :is(
input[type="text"],
textarea
):focus {position: fixed;} /* position as you need */
Note: if areas of the DOM are loaded dynamically with AJAX, wrap the JS in a function & run each time the AJAX has finished loading.