@angular/cdk 14.0.0-next.7 → 14.0.0-next.8

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.
package/fesm2020/a11y.mjs CHANGED
@@ -2133,10 +2133,12 @@ class FocusMonitor {
2133
2133
  return;
2134
2134
  }
2135
2135
  this._setClasses(element);
2136
- this._emitOrigin(elementInfo.subject, null);
2136
+ this._emitOrigin(elementInfo, null);
2137
2137
  }
2138
- _emitOrigin(subject, origin) {
2139
- this._ngZone.run(() => subject.next(origin));
2138
+ _emitOrigin(info, origin) {
2139
+ if (info.subject.observers.length) {
2140
+ this._ngZone.run(() => info.subject.next(origin));
2141
+ }
2140
2142
  }
2141
2143
  _registerGlobalListeners(elementInfo) {
2142
2144
  if (!this._platform.isBrowser) {
@@ -2194,7 +2196,7 @@ class FocusMonitor {
2194
2196
  /** Updates all the state on an element once its focus origin has changed. */
2195
2197
  _originChanged(element, origin, elementInfo) {
2196
2198
  this._setClasses(element, origin);
2197
- this._emitOrigin(elementInfo.subject, origin);
2199
+ this._emitOrigin(elementInfo, origin);
2198
2200
  this._lastFocusOrigin = origin;
2199
2201
  }
2200
2202
  /**