-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
Closed
Closed
Copy link
Labels
internalBehind-the-scenes enhancement. Formerly called “core”.Behind-the-scenes enhancement. Formerly called “core”.scope: modalChanges related to the modal.Changes related to the modal.type: enhancementIt’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature.It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature.
Description
Change the implementation of getScrollbarSize to avoid the need to use non-null assertion. See #43818 (comment)
export default function getScrollbarSize(win: Window = window): number {
// https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes
const documentWidth = win.document.documentElement.clientWidth;
return Math.abs(win.innerWidth - documentWidth);
}Search keywords:
Metadata
Metadata
Assignees
Labels
internalBehind-the-scenes enhancement. Formerly called “core”.Behind-the-scenes enhancement. Formerly called “core”.scope: modalChanges related to the modal.Changes related to the modal.type: enhancementIt’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature.It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature.