@angular/cdk 15.2.4 → 15.2.6

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.
@@ -8,11 +8,11 @@ import { Injectable, Inject, Optional, ElementRef, ApplicationRef, ANIMATION_MOD
8
8
  import { coerceCssPixelValue, coerceArray, coerceBooleanProperty } from '@angular/cdk/coercion';
9
9
  import * as i1$1 from '@angular/cdk/platform';
10
10
  import { supportsScrollBehavior, _getEventTarget, _isTestEnvironment } from '@angular/cdk/platform';
11
+ import { filter, take, takeUntil, takeWhile } from 'rxjs/operators';
11
12
  import * as i5 from '@angular/cdk/bidi';
12
13
  import { BidiModule } from '@angular/cdk/bidi';
13
14
  import { DomPortalOutlet, TemplatePortal, PortalModule } from '@angular/cdk/portal';
14
15
  import { Subject, Subscription, merge } from 'rxjs';
15
- import { take, takeUntil, takeWhile } from 'rxjs/operators';
16
16
  import { ESCAPE, hasModifierKey } from '@angular/cdk/keycodes';
17
17
 
18
18
  /**
@@ -137,7 +137,10 @@ class CloseScrollStrategy {
137
137
  if (this._scrollSubscription) {
138
138
  return;
139
139
  }
140
- const stream = this._scrollDispatcher.scrolled(0);
140
+ const stream = this._scrollDispatcher.scrolled(0).pipe(filter(scrollable => {
141
+ return (!scrollable ||
142
+ !this._overlayRef.overlayElement.contains(scrollable.getElementRef().nativeElement));
143
+ }));
141
144
  if (this._config && this._config.threshold && this._config.threshold > 1) {
142
145
  this._initialScrollPosition = this._viewportRuler.getViewportScrollPosition().top;
143
146
  this._scrollSubscription = stream.subscribe(() => {