Search code examples
angularjscordovaionic-frameworkngcordova

How to show accessory input toolbar using forms in ionicframework?


This is from the docs enter image description here

This is my code and output enter image description here

What should be added to show the toolbar with done button?


Solution

  • To be able to see the Done button, you will need to download Cordova keyboard plugin: http://ngcordova.com/docs/plugins/keyboard/

    Then use this line:

    cordova.plugins.Keyboard.hideKeyboardAccessoryBar(false);
    

    Something like this:

    module.controller('MyCtrl', function($scope, $cordovaKeyboard) {
    
      $cordovaKeyboard.hideAccessoryBar(false)
    
    });
    

    This example will work only if you include ngCordova to your Ionic project.

    More information can be found here: https://github.com/driftyco/ionic-plugin-keyboard

    Keyboard.hideKeyboardAccessoryBar Hide the keyboard accessory bar with the next, previous and done buttons.

    cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true); cordova.plugins.Keyboard.hideKeyboardAccessoryBar(false);

    Precisely the buttons you can see on a top image.