File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
packages/uui-popover-container/lib Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -356,7 +356,7 @@ export class UUIPopoverContainerElement extends LitElement {
356356 }
357357
358358 const includeHidden = false ;
359- const excludeStaticParent = style . position === 'absolute' ;
359+ let excludeStaticParent = style . position === 'absolute' ;
360360 const overflowRegex = includeHidden
361361 ? / ( a u t o | s c r o l l | h i d d e n ) /
362362 : / ( a u t o | s c r o l l ) / ;
@@ -369,6 +369,11 @@ export class UUIPopoverContainerElement extends LitElement {
369369 el = this . #getAncestorElement( el ) ;
370370 continue ;
371371 }
372+
373+ if ( style . position !== 'static' ) {
374+ excludeStaticParent = style . position === 'absolute' ;
375+ }
376+
372377 if (
373378 overflowRegex . test ( style . overflow + style . overflowY + style . overflowX )
374379 ) {
@@ -386,10 +391,10 @@ export class UUIPopoverContainerElement extends LitElement {
386391 #getAncestorElement( el : HTMLElement | null ) : HTMLElement | null {
387392 if ( el ?. parentElement ) {
388393 return el . parentElement ;
389- } else {
390- // If we had no parentElement, then check for shadow roots:
391- return ( el ?. getRootNode ( ) as any ) ?. host ;
392394 }
395+
396+ // If we had no parentElement, then check for shadow roots:
397+ return ( el ?. getRootNode ( ) as any ) ?. host ;
393398 }
394399
395400 render ( ) {
You can’t perform that action at this time.
0 commit comments