replace 'document.documentElement.clientWidth' to 'window.innerWidth'

This commit is contained in:
Gabe Yuan
2023-09-01 16:11:31 +08:00
parent 503a71302c
commit d570a0f1a2

View File

@@ -16,8 +16,8 @@ export default function Action({ translator, fab }) {
const fabWidth = 40; const fabWidth = 40;
const [showPopup, setShowPopup] = useState(false); const [showPopup, setShowPopup] = useState(false);
const [windowSize, setWindowSize] = useState({ const [windowSize, setWindowSize] = useState({
w: document.documentElement.clientWidth, w: window.innerWidth,
h: document.documentElement.clientHeight, h: window.innerHeight,
}); });
const [moved, setMoved] = useState(false); const [moved, setMoved] = useState(false);
@@ -25,8 +25,8 @@ export default function Action({ translator, fab }) {
() => () =>
debounce(() => { debounce(() => {
setWindowSize({ setWindowSize({
w: document.documentElement.clientWidth, w: window.innerWidth,
h: document.documentElement.clientHeight, h: window.innerHeight,
}); });
}), }),
[] []