Skip to content

Commit e8e8662

Browse files
abbasc52adolgachev
authored andcommitted
fix(cdk/scrolling): Fix undefined error when documentElement.style is undefined (#31904)
(cherry picked from commit 667a007)
1 parent 9214a3e commit e8e8662

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/cdk/platform/features/scrolling.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export function supportsScrollBehavior(): boolean {
4242
}
4343

4444
// If the element can have a `scrollBehavior` style, we can be sure that it's supported.
45-
if ('scrollBehavior' in document.documentElement!.style) {
45+
if (document.documentElement?.style && 'scrollBehavior' in document.documentElement!.style) {
4646
scrollBehaviorSupported = true;
4747
} else {
4848
// At this point we have 3 possibilities: `scrollTo` isn't supported at all, it's

0 commit comments

Comments
 (0)