@@ -22,7 +22,7 @@ import {isElementScrolledOutsideView, isElementClippedByScrolling} from './scrol
2222import { coerceCssPixelValue , coerceArray } from '../../coercion' ;
2323import { Platform } from '../../platform' ;
2424import { OverlayContainer } from '../overlay-container' ;
25- import { OverlayRef } from '../overlay-ref' ;
25+ import { isElement , OverlayRef } from '../overlay-ref' ;
2626
2727// TODO: refactor clipping detection into a separate thing (part of scrolling module)
2828// TODO: doesn't handle both flexible width and height when it has to scroll along both axis.
@@ -537,32 +537,17 @@ export class FlexibleConnectedPositionStrategy implements PositionStrategy {
537537 getPopoverInsertionPoint ( ) : Element | null | { type : 'parent' ; element : Element } {
538538 if ( this . _popoverLocation === 'global' ) {
539539 return null ;
540+ } else if ( this . _popoverLocation !== 'inline' ) {
541+ return this . _popoverLocation ;
540542 }
541543
542- let hostElement : Element | null = null ;
543-
544- if ( this . _popoverLocation === 'inline' ) {
545- if ( this . _origin instanceof ElementRef ) {
546- hostElement = this . _origin . nativeElement ;
547- } else if ( this . _origin instanceof Element ) {
548- hostElement = this . _origin ;
549- }
544+ if ( this . _origin instanceof ElementRef ) {
545+ return this . _origin . nativeElement ;
546+ } else if ( isElement ( this . _origin ) ) {
547+ return this . _origin ;
550548 } else {
551- // this._popoverLocation is {type: 'parent', element: Element}
552- hostElement = this . _popoverLocation . element ;
553- }
554-
555- // If the location is 'inline', we're inserting as a sibling.
556- if ( this . _popoverLocation === 'inline' ) {
557- return hostElement ;
558- }
559-
560- // Otherwise we're inserting as a child.
561- if ( hostElement ) {
562- return { type : 'parent' , element : hostElement } ;
549+ return null ;
563550 }
564-
565- return null ;
566551 }
567552
568553 /**
0 commit comments