-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
@ionic-native/keyboard #2972
Comments
same here! |
Hi @empty-god, It happens for battery status native API too. Thanks |
It's because the internals of ionic-native have changed and if a target is not defined then the boolean 'true' is used instead of the window global |
Any estimated timeline from Ionic Team? |
Find the same issue.
|
As @netsesame2 says, we must now use the https://github.com/ionic-team/cordova-plugin-ionic-keyboard I think on that both |
@Dinath not likely. This is a bug with the Observables provided by the npm package, not an intentional deprecation of features. |
yes in ionic v4 also same problem for Battery status plugin! if you find any solution please let me know |
The mentioned workaround in the first post should also work for the Battery status plugin:
|
Ok there is no target element set on the cordova decorator of some plugins like But the cordova decorator which pass the argument through the wrap method and then the wrapEventObservable method uses a default value. function wrapEventObservable(event: string, element: any): Observable<any> {
element = (typeof window !== 'undefined' && element) ? get(window, element) : element || typeof window !== 'undefined' || {};
return fromEvent(element, event);
} It should be the window. But it's Because of: typeof window !== 'undefined' it should be: window or, if there is a case of using Ionic native without browsers enviroment and no typeof window !== 'undefined' ? window : {} Because the |
@danielsogl @kensodemann I fixed it. Please 🙏, could you merge it and release it as soon as possible? 🙂 (core) Maybe also to branch 5.13.x |
I'm submitting a ... (check one with "x")
[x] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or https://ionicworldwide.herokuapp.com/
Current behavior:
Android Build: Using the Ionic Keyboard package and plugin, subscribing to OnKeyboardWillShow or OnKeyboard will not subscribe and will return "TypeError: Invalid Event Target". I tried several life-cycle methods. None actually subscribed correctly.
Expected behavior:
You should be able to subscribe and run code on Keyboard toggle.
Steps to reproduce:
Related code:
What I used as a workaround:
This shows that the actual event is firing, but there is an issue in the Observable wrapper.
Other information:
#2306
Ionic info: (run
ionic info
from a terminal/cmd prompt and paste output below):Ionic:
ionic (Ionic CLI) : 4.0.3 (C:\Users\aaleksandrov\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : @ionic/angular 4.1.2
@angular-devkit/core : 7.1.4
@angular-devkit/schematics : 7.1.4
@angular/cli : 7.2.1
@ionic/ng-toolkit : not installed
@ionic/schematics-angular : not installed
Cordova:
cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
Cordova Platforms : android 7.1.4
System:
Android SDK Tools : 26.1.1
NodeJS : v10.0.0 (C:\Program Files\nodejs\node.exe)
npm : 5.6.0
OS : Windows 10
Environment:
ANDROID_HOME : C:\Users\aaleksandrov\AppData\Local\Android\Sdk
The text was updated successfully, but these errors were encountered: