Skip to content

fix(keyboard): use cordova-plugin-ionic-keyboard #2743

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 25, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 44 additions & 19 deletions src/@ionic-native/plugins/keyboard/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Observable } from 'rxjs';
* @description
* Keyboard plugin for Cordova.
*
* Requires Cordova plugin: `ionic-plugin-keyboard`. For more info, please see the [Keyboard plugin docs](https://github.com/ionic-team/ionic-plugin-keyboard).
* Requires Cordova plugin: `cordova-plugin-ionic-keyboard`. For more info, please see the [Keyboard plugin docs](https://github.com/ionic-team/cordova-plugin-ionic-keyboard).
*
* @usage
* ```typescript
Expand All @@ -19,16 +19,16 @@ import { Observable } from 'rxjs';
*
* this.keyboard.show();
*
* this.keyboard.close();
* this.keyboard.hide();
*
* ```
*/
@Plugin({
pluginName: 'Keyboard',
plugin: 'ionic-plugin-keyboard',
pluginRef: 'cordova.plugins.Keyboard',
repo: 'https://github.com/ionic-team/ionic-plugin-keyboard',
platforms: ['Android', 'BlackBerry 10', 'iOS', 'Windows']
plugin: 'cordova-plugin-ionic-keyboard',
pluginRef: 'window.Keyboard',
repo: 'https://github.com/ionic-team/cordova-plugin-ionic-keyboard',
platforms: ['Android', 'iOS']
})
@Injectable()
export class Keyboard extends IonicNativePlugin {
Expand All @@ -37,35 +37,34 @@ export class Keyboard extends IonicNativePlugin {
* @param hide {boolean}
*/
@Cordova({ sync: true })
hideKeyboardAccessoryBar(hide: boolean): void {}
hideFormAccessoryBar(hide: boolean): void {}

/**
* Force keyboard to be shown.
* Hide the keyboard if shown.
*/
@Cordova({
sync: true,
platforms: ['Android', 'BlackBerry 10', 'Windows']
platforms: ['iOS', 'Android']
})
show(): void {}
hide(): void {}

/**
* Close the keyboard if open.
* Force keyboard to be shown.
*/
@Cordova({
sync: true,
platforms: ['iOS', 'Android', 'BlackBerry 10', 'Windows']
platforms: ['Android']
})
close(): void {}
show(): void {}

/**
* Prevents the native UIScrollView from moving when an input is focused.
* @param disable {boolean}
* Programatically set the resize mode
*/
@Cordova({
sync: true,
platforms: ['iOS', 'Windows']
platforms: ['iOS']
})
disableScroll(disable: boolean): void {}
setResizeMode(): void {}

/**
* Creates an observable that notifies you when the keyboard is shown. Unsubscribe to observable to cancel event watch.
Expand All @@ -74,22 +73,48 @@ export class Keyboard extends IonicNativePlugin {
@Cordova({
eventObservable: true,
event: 'native.keyboardshow',
platforms: ['iOS', 'Android', 'BlackBerry 10', 'Windows']
platforms: ['iOS', 'Android']
})
onKeyboardShow(): Observable<any> {
return;
}

/**
* Creates an observable that notifies you when the keyboard will show. Unsubscribe to observable to cancel event watch.
* @returns {Observable<any>}
*/
@Cordova({
eventObservable: true,
event: 'keyboardWillShow',
platforms: ['iOS', 'Android']
})
onKeyboardWillShow(): Observable<any> {
return;
}

/**
* Creates an observable that notifies you when the keyboard is hidden. Unsubscribe to observable to cancel event watch.
* @returns {Observable<any>}
*/
@Cordova({
eventObservable: true,
event: 'native.keyboardhide',
platforms: ['iOS', 'Android', 'BlackBerry 10', 'Windows']
platforms: ['iOS', 'Android']
})
onKeyboardHide(): Observable<any> {
return;
}

/**
* Creates an observable that notifies you when the keyboard will hide. Unsubscribe to observable to cancel event watch.
* @returns {Observable<any>}
*/
@Cordova({
eventObservable: true,
event: 'keyboardWillHide',
platforms: ['iOS', 'Android']
})
onKeyboardWillHide(): Observable<any> {
return;
}
}