Keyboard blocking input

When I click on an input box when positioned in the middle of the screen (running on android), the keyboard pops up and covers the input box. If you click on the input box when positioned anywhere elsewhere, the input box div scrolls up so that the keyboard is positioned below the input box, the issue only occurs when the input box is positioned vertically central.

The input box is inside a block and I've tried using scrollIntoView to move it up when clicked, but it doesn't work. It doesn't appear to be the code itself as I've used scrollIntoView successfully elsewhere in the OnRender event within a block.

I tried using adding the code in directly in the block in the OnClick event of the input box. I tried passing it up 2 events to the parent screen as I have a block inside a block. I tried block start and block end. I even tried scrolling to a block at the bottom of the parent screen below the block with the input box, as I thought it may consider the input box div already in view and so didn't reposition it (the bottom block is out of sight when clicking on the input box), but nothing works and the screen is never repositioned at all.

I have read that there are sometimes issues depending on the overflow setting, although that doesn't appear to be the case, having done a few trial and errors. What I want is something like KeyboardAwareScrollView. Has anyone else successfully overcome a similar issue?

Here is an example of code I used:

if (document !== null) {
    var element = document.getElementById($parameters.ContainerId);
    if (element !== null) {
        element.scrollIntoView();
        element.scrollIntoView(false);
        element.scrollIntoView({block: "start"});
        element.scrollIntoView({behaviour: "smooth", block: "start", inline: "nearest"});
    }
}

Also:

if (document !== null) {
    document.getElementById($parameters.ObjectId).scrollIntoView({behaviour:'smooth'});
}

And:

if (document !== null) {
    var myDiv = document.getElementById($parameters.ObjectId);
    myDiv.scrollTop = 0;
}



Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.