From b52fc433b5caaa37b67cbe2af838c8e2a7fc2e42 Mon Sep 17 00:00:00 2001 From: Abbas Cyclewala Date: Tue, 23 Sep 2025 13:18:15 +0530 Subject: [PATCH] fix(cdk/scrolling): Fix undefined error when documentElement.style is undefined --- src/cdk/platform/features/scrolling.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cdk/platform/features/scrolling.ts b/src/cdk/platform/features/scrolling.ts index 724e1023b38f..6395031fabb7 100644 --- a/src/cdk/platform/features/scrolling.ts +++ b/src/cdk/platform/features/scrolling.ts @@ -42,7 +42,7 @@ export function supportsScrollBehavior(): boolean { } // If the element can have a `scrollBehavior` style, we can be sure that it's supported. - if ('scrollBehavior' in document.documentElement!.style) { + if (document.documentElement?.style && 'scrollBehavior' in document.documentElement!.style) { scrollBehaviorSupported = true; } else { // At this point we have 3 possibilities: `scrollTo` isn't supported at all, it's