File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
src/cdk/platform/features Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -34,8 +34,9 @@ let scrollBehaviorSupported: boolean|undefined;
34
34
/** Check whether the browser supports scroll behaviors. */
35
35
export function supportsScrollBehavior ( ) : boolean {
36
36
if ( scrollBehaviorSupported == null ) {
37
- // If we're not in the browser, it can't be supported.
38
- if ( typeof document !== 'object' || ! document ) {
37
+ // If we're not in the browser, it can't be supported. Also check for `Element`, because
38
+ // some projects stub out the global `document` during SSR which can throw us off.
39
+ if ( typeof document !== 'object' || ! document || typeof Element !== 'function' || ! Element ) {
39
40
scrollBehaviorSupported = false ;
40
41
return scrollBehaviorSupported ;
41
42
}
You can’t perform that action at this time.
0 commit comments