Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
cordova-plugin-keyboard
Advanced tools
This plugin provides the
Keyboard
object which has some functions to customize and control the keyboard. It also supports the HideKeyboardFormAccessoryBar (boolean) and KeyboardShrinksView (boolean) preferences in config.xml.
This plugin has only been tested in Cordova 3.2 or greater, and its use in previous Cordova versions is not recommended (potential conflict with keyboard customization code present in the core in previous Cordova versions).
If you do use this plugin in an older Cordova version (again, not recommended), you have to make sure the HideKeyboardFormAccessoryBar and KeyboardShrinksView preference values are always false, and only use the API functions to turn things on/off.
This plugin was based on this Apache project and has a compatible API.
From npm (stable)
cordova plugin add cordova-plugin-keyboard
From github latest (may not be stable)
cordova plugin add https://github.com/cjpearson/cordova-plugin-keyboard
Shrink the WebView when the keyboard comes up.
Keyboard.shrinkView(value, successCallback);
Set to true to shrink the WebView when the keyboard comes up. The WebView shrinks instead of the viewport shrinking and the page scrollable. This applies to apps that position their elements relative to the bottom of the WebView. This is the default behaviour on Android, and makes a lot of sense when building apps as opposed to webpages.
Keyboard.shrinkView(true);
Keyboard.shrinkView(false);
Keyboard.shrinkView(null, function (currentValue) { console.log(currentValue); });
Hide the keyboard toolbar.
Keyboard.hideFormAccessoryBar(value, successCallback);
Set to true to hide the additional toolbar that is on top of the keyboard. This toolbar features the Prev, Next, and Done buttons.
Keyboard.hideFormAccessoryBar(true);
Keyboard.hideFormAccessoryBar(false);
Keyboard.hideFormAccessoryBar(null, function (currentValue) { console.log(currentValue); });
Disable scrolling when the the WebView is shrunk.
Keyboard.disableScrollingInShrinkView(value, successCallback);
Set to true to disable scrolling when the WebView is shrunk.
Keyboard.disableScrollingInShrinkView(true);
Keyboard.disableScrollingInShrinkView(false);
Keyboard.disableScrollingInShrinkView(null, function (currentValue) { console.log(currentValue); });
Hide the keyboard
Keyboard.hide();
Call this method to hide the keyboard
Keyboard.hide();
Show the keyboard
Keyboard.show();
Call this method to show the keyboard.
Keyboard.show();
Determine if the keyboard is visible.
if (Keyboard.isVisible) {
// do something
}
Read this property to determine if the keyboard is visible.
Specifies whenether content of page would be automatically scrolled to the top of the page when keyboard is hiding.
Keyboard.automaticScrollToTopOnHiding = true;
Set this to true if you need that page scroll to beginning when keyboard is hiding. This is allows to fix issue with elements declared with position: fixed, after keyboard is hiding.
This event is fired when keyboard fully shown.
window.addEventListener('keyboardDidShow', function () {
// Describe your logic which will be run each time keyboard is shown.
});
Attach handler to this event to be able to receive notification when keyboard is shown.
This event is fired when the keyboard is fully closed.
window.addEventListener('keyboardDidHide', function () {
// Describe your logic which will be run each time keyboard is closed.
});
Attach handler to this event to be able to receive notification when keyboard is closed.
This event fires before keyboard will be shown.
window.addEventListener('keyboardWillShow', function () {
// Describe your logic which will be run each time when keyboard is about to be shown.
});
Attach handler to this event to be able to receive notification when keyboard is about to be shown on the screen.
This event is fired when the keyboard is fully closed.
window.addEventListener('keyboardWillHide', function () {
// Describe your logic which will be run each time when keyboard is about to be closed.
});
Attach handler to this event to be able to receive notification when keyboard is about to be closed.
This event is fired when the keyboard is fully closed.
window.addEventListener('keyboardHeightWillChange', function (event) {
// Describe your logic which will be run each time when keyboard is about to be closed.
console.log(event.keyboardHeight);
});
Attach handler to this event to be able to receive notification when keyboard is about to be closed.
FAQs
Cordova Keyboard Plugin
The npm package cordova-plugin-keyboard receives a total of 711 weekly downloads. As such, cordova-plugin-keyboard popularity was classified as not popular.
We found that cordova-plugin-keyboard demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.