diff --git a/src/PortalWrapper.tsx b/src/PortalWrapper.tsx index a1fe81c6..a5fa3555 100644 --- a/src/PortalWrapper.tsx +++ b/src/PortalWrapper.tsx @@ -17,7 +17,7 @@ export function getOpenCount() { // https://github.com/ant-design/ant-design/issues/19340 // https://github.com/ant-design/ant-design/issues/19332 -let cacheOverflow = {}; +let cacheOverflow: React.CSSProperties = {}; const getParent = (getContainer: GetContainer) => { if (!supportDom) { diff --git a/src/getScrollBarSize.tsx b/src/getScrollBarSize.tsx index 77092c06..35709437 100644 --- a/src/getScrollBarSize.tsx +++ b/src/getScrollBarSize.tsx @@ -68,11 +68,12 @@ ${heightStyle} // Measure. Get fallback style if provided const scrollWidth = - ele && fallbackWidth && !isNaN(fallbackWidth) + ele && fallbackWidth && !Number.isNaN(fallbackWidth) ? fallbackWidth : measureEle.offsetWidth - measureEle.clientWidth; + const scrollHeight = - ele && fallbackHeight && !isNaN(fallbackHeight) + ele && fallbackHeight && !Number.isNaN(fallbackHeight) ? fallbackHeight : measureEle.offsetHeight - measureEle.clientHeight; diff --git a/src/isMobile.ts b/src/isMobile.ts index 05b94d62..7bb3c2ff 100644 --- a/src/isMobile.ts +++ b/src/isMobile.ts @@ -2,10 +2,11 @@ import isMobile from 'is-mobile'; let cached: boolean; -export default () => { +const getIsMobile = () => { if (typeof cached === 'undefined') { cached = isMobile(); } - return cached; }; + +export default getIsMobile;