@angular/cdk 17.0.0-next.0 → 17.0.0-next.2

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/fesm2022/menu.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Directive, InjectionToken, Optional, SkipSelf, Inject, Injectable, inject, Injector, ViewContainerRef, EventEmitter, NgZone, ElementRef, Input, Output, ContentChildren, NgModule } from '@angular/core';
2
+ import { Directive, InjectionToken, Optional, SkipSelf, Inject, Injectable, inject, Injector, ViewContainerRef, EventEmitter, NgZone, ElementRef, ChangeDetectorRef, Input, Output, ContentChildren, NgModule } from '@angular/core';
3
3
  import { Overlay, OverlayConfig, STANDARD_DROPDOWN_BELOW_POSITIONS, STANDARD_DROPDOWN_ADJACENT_POSITIONS, OverlayModule } from '@angular/cdk/overlay';
4
4
  import { ENTER, SPACE, UP_ARROW, hasModifierKey, DOWN_ARROW, LEFT_ARROW, RIGHT_ARROW, TAB, ESCAPE } from '@angular/cdk/keycodes';
5
5
  import { startWith, debounceTime, distinctUntilChanged, filter, takeUntil, mergeMap, mapTo, mergeAll, switchMap, skip } from 'rxjs/operators';
@@ -515,6 +515,7 @@ class CdkMenuTrigger extends CdkMenuTriggerBase {
515
515
  this._elementRef = inject(ElementRef);
516
516
  this._overlay = inject(Overlay);
517
517
  this._ngZone = inject(NgZone);
518
+ this._changeDetectorRef = inject(ChangeDetectorRef);
518
519
  this._inputModalityDetector = inject(InputModalityDetector);
519
520
  this._directionality = inject(Directionality, { optional: true });
520
521
  /** The parent menu this trigger belongs to. */
@@ -538,6 +539,7 @@ class CdkMenuTrigger extends CdkMenuTriggerBase {
538
539
  this.opened.next();
539
540
  this.overlayRef = this.overlayRef || this._overlay.create(this._getOverlayConfig());
540
541
  this.overlayRef.attach(this.getMenuContentPortal());
542
+ this._changeDetectorRef.markForCheck();
541
543
  this._subscribeToOutsideClicks();
542
544
  }
543
545
  }
@@ -546,6 +548,7 @@ class CdkMenuTrigger extends CdkMenuTriggerBase {
546
548
  if (this.isOpen()) {
547
549
  this.closed.next();
548
550
  this.overlayRef.detach();
551
+ this._changeDetectorRef.markForCheck();
549
552
  }
550
553
  this._closeSiblingTriggers();
551
554
  }