cordova-plugin-ionic-keyboard
Advanced tools
Comparing version 2.1.3 to 2.2.0
{ | ||
"name": "cordova-plugin-ionic-keyboard", | ||
"version": "2.1.3", | ||
"version": "2.2.0", | ||
"description": "Ionic Keyboard Plugin", | ||
@@ -28,5 +28,5 @@ "scripts": { | ||
"devDependencies": { | ||
"np": "^2.16.0", | ||
"np": "^5.0.3", | ||
"sync-cordova-xml": "^0.4.0" | ||
} | ||
} |
@@ -16,3 +16,3 @@ # cordova-plugin-ionic-keyboard | ||
### KeyboardResize | ||
### KeyboardResize (for iOS only) | ||
@@ -29,3 +29,3 @@ > Boolean (true by default) | ||
### KeyboardResizeMode | ||
### KeyboardResizeMode (for iOS only) | ||
@@ -44,6 +44,46 @@ > String ('native' by default) | ||
### KeyboardStyle (for iOS only) | ||
> String ('light' by default) | ||
#### Possible values | ||
- `light` | ||
- `dark` | ||
```xml | ||
<preference name="KeyboardStyle" value="dark" /> | ||
``` | ||
### HideKeyboardFormAccessoryBar (for iOS only) | ||
> Boolean (true by default) | ||
#### Possible values | ||
- `true`: hides the keyboard accessory bar. | ||
- `false`: shows the keyboard accessory bar. | ||
```xml | ||
<preference name="HideKeyboardFormAccessoryBar" value="false" /> | ||
``` | ||
### resizeOnFullScreen (for Android only) | ||
There is an Android bug that prevents the keyboard from resizing the WebView when the app is in full screen (i.e. if StatusBar plugin is used to hide the StatusBar). This setting, if set to true, add a workaround that resizes the WebView even when the app is in full screen. | ||
> Boolean (false by default) | ||
#### Possible values | ||
- `false`: doesn't resize the WebView when the app is in full screen. | ||
- `true`: resizes the WebView when the app is in full screen. | ||
```xml | ||
<preference name="resizeOnFullScreen" value="true" /> | ||
``` | ||
## Methods | ||
### Keyboard.hideFormAccessoryBar | ||
### Keyboard.hideFormAccessoryBar (for iOS only) | ||
@@ -58,3 +98,3 @@ > Hide the keyboard toolbar. | ||
##### Quick Example | ||
#### Quick Example | ||
@@ -77,5 +117,4 @@ ```js | ||
### Keyboard.show (for Android only) | ||
### Keyboard.show | ||
> Show the keyboard | ||
@@ -89,2 +128,35 @@ | ||
### Keyboard.setResizeMode (for iOS only) | ||
> Programmatically set the resize mode | ||
Call the method with parameter to set the resize mode. | ||
```js | ||
// Possible values are the same as for 'KeyboardResizeMode' preference | ||
Keyboard.setResizeMode('native'); | ||
Keyboard.setResizeMode('body'); | ||
Keyboard.setResizeMode('ionic'); | ||
``` | ||
### Keyboard.setKeyboardStyle (for iOS only) | ||
> Programmatically set the keyboard style | ||
```js | ||
// Possible values are the same as for 'KeyboardStyle' preference | ||
Keyboard.setKeyboardStyle('light'); // <- default | ||
Keyboard.setKeyboardStyle('dark'); | ||
``` | ||
### Keyboard.disableScroll (for iOS only) | ||
> Programmatically enable or disable the WebView scroll | ||
```js | ||
Keyboard.disableScroll(true); // <- default | ||
Keyboard.disableScroll(false); | ||
``` | ||
## Properties | ||
@@ -146,3 +218,3 @@ | ||
> This event is fired when the keyboard is fully closed. | ||
> This event fires before keyboard will be closed. | ||
@@ -149,0 +221,0 @@ Attach handler to this event to be able to receive notification when keyboard is about to be closed. |
@@ -6,3 +6,2 @@ var argscheck = require('cordova/argscheck'), | ||
var Keyboard = function () {}; | ||
@@ -43,15 +42,15 @@ | ||
Keyboard.hideFormAccessoryBar = Keyboard.hideKeyboardAccessoryBar = function (hide) { | ||
exec(null, null, "Keyboard", "hideKeyboardAccessoryBar", [hide]); | ||
console.warn("Keyboard.hideKeyboardAccessoryBar() not supported in Android"); | ||
}; | ||
Keyboard.hide = function () { | ||
exec(null, null, "Keyboard", "hide", []); | ||
exec(null, null, "CDVIonicKeyboard", "hide", []); | ||
}; | ||
Keyboard.show = function () { | ||
exec(null, null, "Keyboard", "show", []); | ||
exec(null, null, "CDVIonicKeyboard", "show", []); | ||
}; | ||
Keyboard.disableScroll = function (disable) { | ||
console.warn("Keyboard.disableScroll() was removed"); | ||
console.warn("Keyboard.disableScroll() not supported in Android"); | ||
}; | ||
@@ -63,4 +62,8 @@ | ||
Keyboard.setKeyboardStyle = function(style) { | ||
console.warn("Keyboard.setKeyboardStyle() not supported in Android"); | ||
}; | ||
channel.onCordovaReady.subscribe(function () { | ||
exec(success, null, 'Keyboard', 'init', []); | ||
exec(success, null, 'CDVIonicKeyboard', 'init', []); | ||
@@ -67,0 +70,0 @@ function success(msg) { |
@@ -73,5 +73,5 @@ /* | ||
if (hide !== null && hide !== undefined) { | ||
exec(success, null, "Keyboard", "hideFormAccessoryBar", [hide]); | ||
exec(success, null, "CDVIonicKeyboard", "hideFormAccessoryBar", [hide]); | ||
} else { | ||
exec(success, null, "Keyboard", "hideFormAccessoryBar", []); | ||
exec(success, null, "CDVIonicKeyboard", "hideFormAccessoryBar", []); | ||
} | ||
@@ -81,3 +81,3 @@ }; | ||
Keyboard.hide = function () { | ||
exec(null, null, "Keyboard", "hide", []); | ||
exec(null, null, "CDVIonicKeyboard", "hide", []); | ||
}; | ||
@@ -92,11 +92,15 @@ | ||
Keyboard.disableScroll = function (disable) { | ||
console.warn("Keyboard.disableScroll() was removed"); | ||
exec(null, null, "CDVIonicKeyboard", "disableScroll", [disable]); | ||
}; | ||
Keyboard.setResizeMode = function (mode) { | ||
exec(null, null, "Keyboard", "setResizeMode", [mode]); | ||
exec(null, null, "CDVIonicKeyboard", "setResizeMode", [mode]); | ||
} | ||
Keyboard.setKeyboardStyle = function(style) { | ||
exec(null, null, "CDVIonicKeyboard", "keyboardStyle", [style]); | ||
}; | ||
Keyboard.isVisible = false; | ||
module.exports = Keyboard; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
37253
150
221
1