Hide keyboard on tap or scroll events of page

I have form inside the modal with couple of input fields. How can I hide the keyboard whenever user tap on the page/form or scroll the page ? I have seen such UX behavior in many native apps ?
How can we achieve same in ionic ?