Search code examples
javascriptangularionic-frameworkcapacitor

Ionic Capacitor (Angular): how to prevent closing of keyboard after "submit" with enter key


In Ionic Capacitor (I am using Angular): How do I keep displaying the keyboard open, prevent it from closing, when the user submits the form or input?

I know there are questions like this one on StackOverflow, but they refer to Ionic Cordova and not Ionic Capacitor.

I want this to work on native IOS/Android, I don't care about PWA. (and dont care about Desktop-Web of course, since it doesnt even have a keyboard on the screen).


Solution

  • Did you try event.preventDefault() and/or returning false from your submit handler function? These are usually the "tricks" to prevent such things (like keyboard closing) from happening.