Skip to content

Dev to Feature #536

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Nov 30, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: use window inner width instead of screen width
  • Loading branch information
raheeliftikhar5 committed Nov 30, 2023
commit 2bf6d87735c48a083a08e234477129b9c6d2a287
9 changes: 7 additions & 2 deletions client/packages/lowcoder/src/comps/hooks/screenInfoComp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,16 @@ function useScreenInfo() {
}

const getScreenInfo = useCallback(() => {
const { width, height } = window.screen;
const { innerWidth, innerHeight } = window;
const deviceType = getDeviceType();
const flags = getFlagsByDeviceType(deviceType);

return { width, height, deviceType, ...flags };
return {
width: innerWidth,
height: innerHeight,
deviceType,
...flags
};
}, [])

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