File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
core/src/components/popover Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,7 @@ export class Popover implements ComponentInterface, PopoverInterface {
6464 private destroyTriggerInteraction ?: ( ) => void ;
6565 private destroyKeyboardInteraction ?: ( ) => void ;
6666 private destroyDismissInteraction ?: ( ) => void ;
67+ private headerResizeObserver ?: ResizeObserver ;
6768
6869 private inline = false ;
6970 private workingDelegate ?: FrameworkDelegate ;
@@ -361,6 +362,11 @@ export class Popover implements ComponentInterface, PopoverInterface {
361362 if ( destroyTriggerInteraction ) {
362363 destroyTriggerInteraction ( ) ;
363364 }
365+
366+ if ( this . headerResizeObserver ) {
367+ this . headerResizeObserver . disconnect ( ) ;
368+ this . headerResizeObserver = undefined ;
369+ }
364370 }
365371
366372 componentWillLoad ( ) {
@@ -562,16 +568,17 @@ export class Popover implements ComponentInterface, PopoverInterface {
562568 return ;
563569 }
564570
565- const ro = new ResizeObserver ( async ( ) => {
571+ this . headerResizeObserver = new ResizeObserver ( async ( ) => {
566572 if ( header . offsetHeight > 0 ) {
567- ro . disconnect ( ) ;
573+ this . headerResizeObserver ?. disconnect ( ) ;
574+ this . headerResizeObserver = undefined ;
568575 for ( const contentEl of contentElements ) {
569576 await contentEl . recalculateDimensions ( ) ;
570577 }
571578 }
572579 } ) ;
573580
574- ro . observe ( header ) ;
581+ this . headerResizeObserver . observe ( header ) ;
575582 }
576583
577584 /**
You can’t perform that action at this time.
0 commit comments