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 [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,
});
}),
[]