How to hide the keyboard?

first of all sorry if my question is stupid but I’m new to Ionic, Angular and TypeScript.
I’m desperately trying to hide the keyboard after the user hits ‘return’ from my search bar and nothing that I’ve tried so far worked.

I’ve followed these steps but whenever I call an instance, it doesn’t work.

For example :

My “search.ts” has “import { Keyboard } from '@ionic-native/keyboard'

  constructor(public navCtrl: NavController, public navParams: NavParams, public api: ApiProvider, public keyboard: Keyboard) {

And wherever I call “”

Can anybody explain me why ?

Thank you

Anyone knows :frowning:?

Try to change the focus from the input box to any other control. I think keyboard will hide automaticaly when the focus change

try with this :


import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import { Keyboard } from '@ionic-native/keyboard';
import { DatePicker } from '@ionic-native/date-picker';

  selector: 'page-home',
  templateUrl: 'home.html'
export class HomePage {

  constructor(public navCtrl: NavController, public keyboard : Keyboard, public datePicker : DatePicker) {


  today : any;
      date: new Date(),
      mode: 'date',
      androidTheme: this.datePicker.ANDROID_THEMES.THEME_DEVICE_DEFAULT_LIGHT
      date => {'/'+date.getMonth()+'/'+date.getFullYear()},
      err => console.log('Error occurred while getting date: ', err)



      Ionic Blank

<ion-content padding>
      <ion-input disabled="true" type="text" name="DOB" (click)="openDatepicker()" [(ngModel)]="today" ng-readonly></ion-input>