mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 19:57:22 +08:00
fix(angular): Fix cordova browser error when resumed (#16810)
* fix cordova resume error In cordova browser error is thrown everytime tab/window is reactivated: Uncaught TypeError: Cannot read property 'detail' of undefined at Channel.<anonymous> (util.js:10) at Channel.fire (cordova.js:798) at HTMLDocument.<anonymous> (cordova.js:1511) That was fixed in previous commits, by in latest was reintroduced again. * update types
This commit is contained in:
@ -10,8 +10,9 @@ export function inputs(instance: any, el: ElementRef, props: string[]) {
|
||||
}
|
||||
|
||||
export function proxyEvent<T>(emitter: Subject<T>, el: EventTarget, eventName: string) {
|
||||
el.addEventListener(eventName, ev => {
|
||||
emitter.next((ev as any).detail as T);
|
||||
el.addEventListener(eventName, (ev: Event | undefined | null) => {
|
||||
// ?? cordova might emit "null" events
|
||||
emitter.next(ev != null ? (ev as any).detail as T : undefined);
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user