Skip to content

Commit 2bf6d87

Browse files
fix: use window inner width instead of screen width
1 parent 38fe46f commit 2bf6d87

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

client/packages/lowcoder/src/comps/hooks/screenInfoComp.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,16 @@ function useScreenInfo() {
4040
}
4141

4242
const getScreenInfo = useCallback(() => {
43-
const { width, height } = window.screen;
43+
const { innerWidth, innerHeight } = window;
4444
const deviceType = getDeviceType();
4545
const flags = getFlagsByDeviceType(deviceType);
4646

47-
return { width, height, deviceType, ...flags };
47+
return {
48+
width: innerWidth,
49+
height: innerHeight,
50+
deviceType,
51+
...flags
52+
};
4853
}, [])
4954

5055
const [screenInfo, setScreenInfo] = useState<ScreenInfo>({});

0 commit comments

Comments
 (0)