From 00893974b5bc1538bf74b35c2eb6a8d6c20a1ca4 Mon Sep 17 00:00:00 2001 From: gzhiying <294962285@qq.com> Date: Fri, 13 Aug 2021 09:53:36 +0800 Subject: [PATCH 1/2] fixed getTargetScrollBarSize issues in Firefox --- src/getScrollBarSize.tsx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/getScrollBarSize.tsx b/src/getScrollBarSize.tsx index 12a142f3..af597f78 100644 --- a/src/getScrollBarSize.tsx +++ b/src/getScrollBarSize.tsx @@ -54,9 +54,13 @@ export function getTargetScrollBarSize(target: HTMLElement) { return { width: 0, height: 0 }; } - const { width, height } = getComputedStyle(target, '::-webkit-scrollbar'); - return { - width: ensureSize(width), - height: ensureSize(height), - }; + try { + const { width, height } = getComputedStyle(target, '::-webkit-scrollbar'); + return { + width: ensureSize(width), + height: ensureSize(height), + }; + } catch (e) { + return { width: 0, height: 0 }; + } } From dcbc58160528cbc5b53da5548399c3e84e4ea5df Mon Sep 17 00:00:00 2001 From: gzhiying <294962285@qq.com> Date: Mon, 16 Aug 2021 13:55:27 +0800 Subject: [PATCH 2/2] v5.13.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 082aea87..6bf59d24 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rc-util", - "version": "5.13.2", + "version": "5.13.3", "description": "Common Utils For React Component", "keywords": [ "react",