Adding a keyboard hide button to the accessory panel in Ionic

I use an ionic structure to build my application, and I use many forms with modals. To move between fields, the user usually clicks on a space where there is no image, but this can lead to unexpected behavior.

I would like the button to hide the keyboard in the same way as the image below.

iOS keyboard accessory bar

+7
ios cordova ionic-framework
source share
1 answer

If you use a cord, you can install this plugin first

cordova plugin add com.ionic.keyboard 

Then in your callback, initiate

 cordova.plugins.Keyboard.close(); 

Some information about attaching an item above the keyboard.

keyboard-attach is an attribute directive that calls an element to pop up above the keyboard when the keyboard is displayed. Currently only supports the ion-footer directive.

In iOS, if there is an input in your footer, you need to set

 cordova.plugins.Keyboard.disableScroll(true) 

Using

 <ion-footer-bar align-title="left" keyboard-attach class="bar-assertive"> <h1 class="title">Title!</h1> </ion-footer-bar> 
+2
source share

All Articles