File tree Expand file tree Collapse file tree 1 file changed +13
-9
lines changed
src/material-experimental/mdc-progress-bar Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -101,15 +101,19 @@ export class MatProgressBar extends _MatProgressBarMixinBase implements AfterVie
101
101
( window as unknown as WithMDCResizeObserver ) . ResizeObserver ;
102
102
103
103
if ( resizeObserverConstructor ) {
104
- const observer = new resizeObserverConstructor ( callback ) ;
105
-
106
- // Internal client users found production errors where `observe` was not a function
107
- // on the constructed `observer`. This should not happen, but adding this check for this
108
- // edge case.
109
- if ( typeof observer . observe === 'function' ) {
110
- observer . observe ( this . _rootElement ) ;
111
- return observer ;
112
- }
104
+ return this . _ngZone . runOutsideAngular ( ( ) => {
105
+ const observer = new resizeObserverConstructor ( callback ) ;
106
+
107
+ // Internal client users found production errors where `observe` was not a function
108
+ // on the constructed `observer`. This should not happen, but adding this check for this
109
+ // edge case.
110
+ if ( typeof observer . observe === 'function' ) {
111
+ observer . observe ( this . _rootElement ) ;
112
+ return observer ;
113
+ }
114
+
115
+ return null ;
116
+ } ) ;
113
117
}
114
118
115
119
return null ;
You can’t perform that action at this time.
0 commit comments