Closed Keyboard opens itself if input is focused and scrolling view


#1

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;
}

#2

Please help me anyone
I tried now another workaround with jQuery:
If the keyboardclosed event is fired I manually blur out of the input field so this isn’t focused anymore and then if I am scrolling the keyboard doesn’t open by itself.
But with including jQuery (instead of using by default angular included jQuerylite which hasn’t my required functionality) I think that the performance of my app has got worse than before (page transition times).
Has anyone made the same experiences?