Hello all,
I’ve got following problem:
I have a focused text-input-field and manually close the keyboard. If I am then scrolling in my view sometimes the keyboard is opening by itself. Is there any way to prevent the keyboard from opening if it was closed manually before and a input text field is focused.
Also this is happening only sometimes independent where I tap the screen to scroll (anywhere on the screen or in the input field) and also indepentent how long I touch the screen before scrolling (onTap or onHold or something like that). It happens totally randomly.
I fixed this now with this piece of code but the the screen is shortly flimmering because the keyboard tries to popup.
Is there any method or event which is fired before the keyboard tries to popup so I can close it again.
Thank you in advance.
My HTML looks similar like this:
<ion-view >
<ion-content class="trip-detail-content" on-scroll="gotScrolled()" scroll-event-interval="100">
<p>Name</p><input type="text">
</ion-content>
<ion-footer-bar >...</ion-footer-bar>
</ion-view>
And build a workaround with this javascript code:
var keyboardopen;
$scope.gotScrolled=function() {
if(!keyBoardOpen){
cordova.plugins.Keyboard.close();
}
};
window.addEventListener('native.keyboardshow', keyboardShowHandler);
function keyboardShowHandler(e){
keyBoardOpen = true;
}
window.addEventListener('native.keyboardhide', keyboardHideHandler);
function keyboardHideHandler(e){
keyBoardOpen = false;
}