@@ -122,8 +122,9 @@ export class ConnectedPositionStrategy implements PositionStrategy {
122
122
}
123
123
124
124
/**
125
- * Sets the list of scrolling or resizing containers that host the connectedTo element so that
126
- * on reposition we can evaluate if it has been clipped when repositioned.
125
+ * Sets the list of Scrollable containers that host the origin element so that
126
+ * on reposition we can evaluate if it or the overlay has been clipped or outside view. Every
127
+ * Scrollable must be an ancestor element of the strategy's origin element.
127
128
*/
128
129
withScrollableContainers ( scrollables : Scrollable [ ] ) {
129
130
this . scrollables = scrollables ;
@@ -252,15 +253,15 @@ export class ConnectedPositionStrategy implements PositionStrategy {
252
253
* or completely outside the view of any of the strategy's scrollables.
253
254
*/
254
255
private getScrollableViewProperties ( overlay : HTMLElement ) : ScrollableViewProperties {
255
- const triggerBounds = this . _getElementBounds ( this . _connectedTo . nativeElement ) ;
256
+ const originBounds = this . _getElementBounds ( this . _origin ) ;
256
257
const overlayBounds = this . _getElementBounds ( overlay ) ;
257
258
const scrollContainerBounds = this . scrollables . map ( ( scrollable : Scrollable ) => {
258
259
return this . _getElementBounds ( scrollable . getElementRef ( ) . nativeElement ) ;
259
260
} ) ;
260
261
261
262
return {
262
- isTriggerClipped : this . isElementClipped ( triggerBounds , scrollContainerBounds ) ,
263
- isTriggerOutsideView : this . isElementOutsideView ( triggerBounds , scrollContainerBounds ) ,
263
+ isOriginClipped : this . isElementClipped ( originBounds , scrollContainerBounds ) ,
264
+ isOriginOutsideView : this . isElementOutsideView ( originBounds , scrollContainerBounds ) ,
264
265
isOverlayClipped : this . isElementClipped ( overlayBounds , scrollContainerBounds ) ,
265
266
isOverlayOutsideView : this . isElementOutsideView ( overlayBounds , scrollContainerBounds ) ,
266
267
} ;
0 commit comments