replace 'document.documentElement.clientWidth' to 'window.innerWidth'
This commit is contained in:
@@ -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,
|
||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
[]
|
[]
|
||||||
|
|||||||
Reference in New Issue
Block a user