From fb1c9ae0a9dac70fdc7ca6ccf29148cef45fef49 Mon Sep 17 00:00:00 2001 From: Stepan_Sendun Date: Fri, 13 Dec 2019 17:55:45 +0200 Subject: [PATCH 1/2] fix detecting scroo behavior in edge --- 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 3f482bc027f4..cf728032e555 100644 --- a/src/cdk/platform/features/scrolling.ts +++ b/src/cdk/platform/features/scrolling.ts @@ -30,7 +30,7 @@ let rtlScrollAxisType: RtlScrollAxisType; /** Check whether the browser supports scroll behaviors. */ export function supportsScrollBehavior(): boolean { - return !!(typeof document == 'object' && 'scrollBehavior' in document.documentElement!.style); + return !!(typeof document == 'object' && document.documentElement.style && document.documentElement.style.scrollBehavior); } /** From cff771cb110ee5dc61802e8252c4cac0254a3622 Mon Sep 17 00:00:00 2001 From: Stepan_Sendun Date: Fri, 13 Dec 2019 18:16:06 +0200 Subject: [PATCH 2/2] fix lint error --- src/cdk/platform/features/scrolling.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/cdk/platform/features/scrolling.ts b/src/cdk/platform/features/scrolling.ts index cf728032e555..42f565095cab 100644 --- a/src/cdk/platform/features/scrolling.ts +++ b/src/cdk/platform/features/scrolling.ts @@ -30,7 +30,11 @@ let rtlScrollAxisType: RtlScrollAxisType; /** Check whether the browser supports scroll behaviors. */ export function supportsScrollBehavior(): boolean { - return !!(typeof document == 'object' && document.documentElement.style && document.documentElement.style.scrollBehavior); + return !!( + typeof document == 'object' && + document.documentElement.style && + document.documentElement.style.scrollBehavior + ); } /** @@ -75,7 +79,7 @@ export function getRtlScrollAxisType(): RtlScrollAxisType { // return 0 when we read it again. scrollContainer.scrollLeft = 1; rtlScrollAxisType = - scrollContainer.scrollLeft === 0 ? RtlScrollAxisType.NEGATED : RtlScrollAxisType.INVERTED; + scrollContainer.scrollLeft === 0 ? RtlScrollAxisType.NEGATED : RtlScrollAxisType.INVERTED; } scrollContainer.parentNode!.removeChild(scrollContainer);