@ionic/angular 7.5.2-nightly.20231025 → 7.5.3-nightly.20231026

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -577,12 +577,12 @@ class Platform {
577
577
  return ev.register(priority, (processNextHandler) => zone.run(() => callback(processNextHandler)));
578
578
  });
579
579
  };
580
- proxyEvent(this.pause, doc, 'pause');
581
- proxyEvent(this.resume, doc, 'resume');
582
- proxyEvent(this.backButton, doc, 'ionBackButton');
583
- proxyEvent(this.resize, this.win, 'resize');
584
- proxyEvent(this.keyboardDidShow, this.win, 'ionKeyboardDidShow');
585
- proxyEvent(this.keyboardDidHide, this.win, 'ionKeyboardDidHide');
580
+ proxyEvent(this.pause, doc, 'pause', zone);
581
+ proxyEvent(this.resume, doc, 'resume', zone);
582
+ proxyEvent(this.backButton, doc, 'ionBackButton', zone);
583
+ proxyEvent(this.resize, this.win, 'resize', zone);
584
+ proxyEvent(this.keyboardDidShow, this.win, 'ionKeyboardDidShow', zone);
585
+ proxyEvent(this.keyboardDidHide, this.win, 'ionKeyboardDidHide', zone);
586
586
  let readyResolve;
587
587
  this._readyPromise = new Promise((res) => {
588
588
  readyResolve = res;
@@ -765,12 +765,20 @@ const readQueryParam = (url, key) => {
765
765
  const results = regex.exec(url);
766
766
  return results ? decodeURIComponent(results[1].replace(/\+/g, ' ')) : null;
767
767
  };
768
- const proxyEvent = (emitter, el, eventName) => {
768
+ const proxyEvent = (emitter, el, eventName, zone) => {
769
769
  if (el) {
770
770
  el.addEventListener(eventName, (ev) => {
771
- // ?? cordova might emit "null" events
772
- const value = ev != null ? ev.detail : undefined;
773
- emitter.next(value);
771
+ /**
772
+ * `zone.run` is required to make sure that we are running inside the Angular zone
773
+ * at all times. This is necessary since an app that has Capacitor will
774
+ * override the `document.addEventListener` with its own implementation.
775
+ * The override causes the event to no longer be in the Angular zone.
776
+ */
777
+ zone.run(() => {
778
+ // ?? cordova might emit "null" events
779
+ const value = ev != null ? ev.detail : undefined;
780
+ emitter.next(value);
781
+ });
774
782
  });
775
783
  }
776
784
  };