@@ -126,8 +126,9 @@ export class ConnectedPositionStrategy implements PositionStrategy {
126
126
}
127
127
128
128
/**
129
- * Sets the list of scrolling or resizing containers that host the connectedTo element so that
130
- * on reposition we can evaluate if it has been clipped when repositioned.
129
+ * Sets the list of Scrollable containers that host the origin element so that
130
+ * on reposition we can evaluate if it or the overlay has been clipped or outside view. Every
131
+ * Scrollable must be an ancestor element of the strategy's origin element.
131
132
*/
132
133
withScrollableContainers ( scrollables : Scrollable [ ] ) {
133
134
this . scrollables = scrollables ;
@@ -271,15 +272,15 @@ export class ConnectedPositionStrategy implements PositionStrategy {
271
272
* or completely outside the view of any of the strategy's scrollables.
272
273
*/
273
274
private getScrollableViewProperties ( overlay : HTMLElement ) : ScrollableViewProperties {
274
- const triggerBounds = this . _getElementBounds ( this . _connectedTo . nativeElement ) ;
275
+ const originBounds = this . _getElementBounds ( this . _origin ) ;
275
276
const overlayBounds = this . _getElementBounds ( overlay ) ;
276
277
const scrollContainerBounds = this . scrollables . map ( ( scrollable : Scrollable ) => {
277
278
return this . _getElementBounds ( scrollable . getElementRef ( ) . nativeElement ) ;
278
279
} ) ;
279
280
280
281
return {
281
- isTriggerClipped : this . isElementClipped ( triggerBounds , scrollContainerBounds ) ,
282
- isTriggerOutsideView : this . isElementOutsideView ( triggerBounds , scrollContainerBounds ) ,
282
+ isOriginClipped : this . isElementClipped ( originBounds , scrollContainerBounds ) ,
283
+ isOriginOutsideView : this . isElementOutsideView ( originBounds , scrollContainerBounds ) ,
283
284
isOverlayClipped : this . isElementClipped ( overlayBounds , scrollContainerBounds ) ,
284
285
isOverlayOutsideView : this . isElementOutsideView ( overlayBounds , scrollContainerBounds ) ,
285
286
} ;
0 commit comments