From d570a0f1a281e41924bf49fe1408759e7110e7c7 Mon Sep 17 00:00:00 2001 From: Gabe Yuan Date: Fri, 1 Sep 2023 16:11:31 +0800 Subject: [PATCH] replace 'document.documentElement.clientWidth' to 'window.innerWidth' --- src/views/Action/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/views/Action/index.js b/src/views/Action/index.js index 263be6d..dde75b5 100644 --- a/src/views/Action/index.js +++ b/src/views/Action/index.js @@ -16,8 +16,8 @@ export default function Action({ translator, fab }) { const fabWidth = 40; const [showPopup, setShowPopup] = useState(false); const [windowSize, setWindowSize] = useState({ - w: document.documentElement.clientWidth, - h: document.documentElement.clientHeight, + w: window.innerWidth, + h: window.innerHeight, }); const [moved, setMoved] = useState(false); @@ -25,8 +25,8 @@ export default function Action({ translator, fab }) { () => debounce(() => { setWindowSize({ - w: document.documentElement.clientWidth, - h: document.documentElement.clientHeight, + w: window.innerWidth, + h: window.innerHeight, }); }), []