This repository was archived by the owner on Dec 19, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -211,7 +211,18 @@ export const IronOverlayBehaviorImpl = {
211211
212212 /** @override */
213213 detached : function ( ) {
214- dom ( this ) . unobserveNodes ( this . _observer ) ;
214+ // TODO(bicknellr): Per spec, checking `this._observer` should never be
215+ // necessary because `connectedCallback` and `disconnectedCallback` should
216+ // always be called in alternating order. However, the custom elements
217+ // polyfill doesn't implement the reactions stack, so this can sometimes
218+ // happen, particularly if ShadyDOM is in noPatch mode where the custom
219+ // elements polyfill is installed before ShadyDOM. We should investigate
220+ // whether or not we can either implement the reactions stack without major
221+ // performance implications or patch ShadyDOM's functions to restore the
222+ // typical ShadyDOM-then-custom-elements order and remove this workaround.
223+ if ( this . _observer ) {
224+ dom ( this ) . unobserveNodes ( this . _observer ) ;
225+ }
215226 this . _observer = null ;
216227 for ( var cb in this . __rafs ) {
217228 if ( this . __rafs [ cb ] !== null ) {
Original file line number Diff line number Diff line change @@ -270,7 +270,7 @@ export function _shouldPreventScrolling(event) {
270270 */
271271export function _getScrollableNodes ( nodes ) {
272272 var scrollables = [ ] ;
273- var lockingIndex = nodes . indexOf ( currentLockingElement ) ;
273+ var lockingIndex = nodes . indexOf ( /** @type { !Node } */ ( currentLockingElement ) ) ;
274274 // Loop from root target to locking element (included).
275275 for ( var i = 0 ; i <= lockingIndex ; i ++ ) {
276276 // Skip non-Element nodes.
You can’t perform that action at this time.
0 commit comments