@@ -293,6 +293,7 @@ export const DashboardItemMixin = (superClass) =>
293293      super ( ) ; 
294294      this . __keyboardController  =  new  KeyboardController ( this ) ; 
295295      this . __focusTrapController  =  new  FocusTrapController ( this ) ; 
296+       this . __boundRootHeadingLevelChangedListener  =  this . __updateRootHeadingLevel . bind ( this ) ; 
296297    } 
297298
298299    /** @protected  */ 
@@ -401,19 +402,22 @@ export const DashboardItemMixin = (superClass) =>
401402      this . __removeHeadingLevelObserver ( ) ; 
402403      const  parentLayout  =  getParentLayout ( this ) ; 
403404      if  ( parentLayout )  { 
404-         this . __headingLevelObserver  =  new   MutationObserver ( ( )   =>   this . __updateRootHeadingLevel ( ) ) ; 
405-         this . __headingLevelObserver . observe ( parentLayout ,   { 
406-           attributes :  true , 
407-           attributeFilter :  [ 'root-heading-level' ] , 
408-         } ) ; 
405+         this . __rootHeadingLevelListenerTarget  =  parentLayout ; 
406+         parentLayout . addEventListener ( 
407+           'dashboard-root-heading-level-changed' , 
408+           this . __boundRootHeadingLevelChangedListener , 
409+         ) ; 
409410      } 
410411    } 
411412
412413    /** @private  */ 
413414    __removeHeadingLevelObserver ( )  { 
414-       if  ( this . __headingLevelObserver )  { 
415-         this . __headingLevelObserver . disconnect ( ) ; 
416-         this . __headingLevelObserver  =  null ; 
415+       if  ( this . __rootHeadingLevelListenerTarget )  { 
416+         this . __rootHeadingLevelListenerTarget . removeEventListener ( 
417+           'dashboard-root-heading-level-changed' , 
418+           this . __boundRootHeadingLevelChangedListener , 
419+         ) ; 
420+         this . __rootHeadingLevelListenerTarget  =  null ; 
417421      } 
418422    } 
419423
0 commit comments