arnaucube
arnaucube/commonroutesServerPublic Self-hosted repository
commonroutesServer/www/plugins/ionic-plugin-keyboard/README.md
www/plugins/ionic-plugin-keyboard/README.mdRaw
  1Keyboard
  2======
  3
  4The `cordova.plugins.Keyboard` object provides functions to make interacting with the keyboard easier, and fires events to indicate that the keyboard will hide/show.
  5
  6    cordova plugin add ionic-plugin-keyboard
  7
  8Methods
  9-------
 10
 11- cordova.plugins.Keyboard.hideKeyboardAccessoryBar
 12- cordova.plugins.Keyboard.close
 13- cordova.plugins.Keyboard.disableScroll
 14- cordova.plugins.Keyboard.show
 15
 16Properties
 17--------
 18
 19- cordova.plugins.Keyboard.isVisible
 20
 21Events
 22--------
 23
 24These events are fired on the window.
 25
 26- native.keyboardshow
 27  * A number `keyboardHeight` is given on the event object, which is the pixel height of the keyboard.
 28- native.keyboardhide
 29
 30
 31# API reference
 32
 33Keyboard.hideKeyboardAccessoryBar
 34=================
 35
 36Hide the keyboard accessory bar with the next, previous and done buttons.
 37
 38    cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
 39    cordova.plugins.Keyboard.hideKeyboardAccessoryBar(false);
 40
 41Supported Platforms
 42-------------------
 43
 44- iOS
 45
 46
 47Keyboard.close
 48=================
 49
 50Close the keyboard if it is open.
 51
 52    cordova.plugins.Keyboard.close();
 53
 54Supported Platforms
 55-------------------
 56
 57- iOS, Android, Blackberry 10, Windows
 58
 59
 60Keyboard.disableScroll
 61=================
 62
 63Prevent the native UIScrollView from moving when an input is focused.  The telltale sign that this is happening is the top of your app scrolls out of view (if using Ionic, your header bar will disappear).
 64
 65This does *not* prevent any DOM elements from being able to scroll.  That needs to happen from CSS and JavaScript, not this plugin. 
 66
 67    cordova.plugins.Keyboard.disableScroll(true);
 68    cordova.plugins.Keyboard.disableScroll(false);
 69
 70Supported Platforms
 71-------------------
 72
 73- iOS, Windows
 74
 75Keyboard.show
 76=================
 77
 78Force keyboard to be shown. This typically helps if autofocus on a text element does not pop up the keyboard automatically
 79
 80    cordova.plugins.Keyboard.show();
 81
 82Supported Platforms
 83
 84- Android, Blackberry 10, Windows
 85
 86native.keyboardshow
 87=================
 88
 89This event fires when the keyboard will be shown or when the keyboard frame resizes (when switching between keyboards for example)
 90
 91    window.addEventListener('native.keyboardshow', keyboardShowHandler);
 92
 93    function keyboardShowHandler(e){
 94        alert('Keyboard height is: ' + e.keyboardHeight);
 95    }
 96
 97Properties
 98-----------
 99
100keyboardHeight: the height of the keyboard in pixels
101
102
103Supported Platforms
104-------------------
105
106- iOS, Android, Blackberry 10, Windows
107
108
109native.keyboardhide
110=================
111
112This event fires when the keyboard will hide
113
114    window.addEventListener('native.keyboardhide', keyboardHideHandler);
115
116    function keyboardHideHandler(e){
117        alert('Goodnight, sweet prince');
118    }
119
120Properties
121-----------
122
123None
124
125Supported Platforms
126-------------------
127
128- iOS, Android, Blackberry 10, Windows