Hide Keyboard programmatically on Enter button

I developed cordova ionic 7 angular app.

It’s very strange. I have ion-input but when I click on Enter button, the keyboard not hide. So I think that hide keyboard programmatically.

Some years ago I used ionic-native but probably it is deprecated. I can’t imnport it in my app.

import { Keyboard } from '@ionic-native/keyboard/ngx'; 

constructor(private keyboard: Keyboard) { }


Now I used Native Keyboard but it not works

$ ionic cordova plugin add cordova-plugin-native-keyboard
$ npm install @awesome-cordova-plugins/native-keyboard

import { NativeKeyboard } from '@awesome-cordova-plugins/native-keyboard/ngx';

  constructor(private keyboard: NativeKeyboard) {}
  keyup(evt: any) {
    if (evt != null && evt.key == "Enter") {      

can you help me to implement it?


Check this out - Keyboard Capacitor Plugin API | Capacitor Documentation