Skip to content

fix(platform): RTL scrolling behavior detection not using cached value in some cases #18389

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 20, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/cdk/platform/features/scrolling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ export enum RtlScrollAxisType {
}

/** Cached result of the way the browser handles the horizontal scroll axis in RTL mode. */
let rtlScrollAxisType: RtlScrollAxisType;
let rtlScrollAxisType: RtlScrollAxisType|undefined;

/** Check whether the browser supports scroll behaviors. */
export function supportsScrollBehavior(): boolean {
return !!(typeof document == 'object' && 'scrollBehavior' in document.documentElement!.style);
return !!(typeof document == 'object' && 'scrollBehavior' in document.documentElement!.style);
}

/**
Expand All @@ -43,7 +43,7 @@ export function getRtlScrollAxisType(): RtlScrollAxisType {
return RtlScrollAxisType.NORMAL;
}

if (!rtlScrollAxisType) {
if (rtlScrollAxisType == null) {
// Create a 1px wide scrolling container and a 2px wide content element.
const scrollContainer = document.createElement('div');
const containerStyle = scrollContainer.style;
Expand Down