Skip to content

Done with the problem faced of loosing screen. #2491

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 5 commits into from
Jan 11, 2024
Merged
Changes from all commits
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
13 changes: 13 additions & 0 deletions client/modules/IDE/pages/IDEView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ const IDEView = () => {
const [consoleSize, setConsoleSize] = useState(150);
const [sidebarSize, setSidebarSize] = useState(160);
const [isOverlayVisible, setIsOverlayVisible] = useState(false);
const [MaxSize, setMaxSize] = useState(window.innerWidth);

const cmRef = useRef({});

Expand Down Expand Up @@ -146,6 +147,17 @@ const IDEView = () => {
}
};
}, [shouldAutosave, dispatch]);
useEffect(() => {
const updateInnerWidth = (e) => {
setMaxSize(e.target.innerWidth);
};

window.addEventListener('resize', updateInnerWidth);

return () => {
window.removeEventListener('resize', updateInnerWidth);
};
}, [setMaxSize]);

const consoleCollapsedSize = 29;
const currentConsoleSize = ide.consoleIsExpanded
Expand Down Expand Up @@ -179,6 +191,7 @@ const IDEView = () => {
<Sidebar />
<SplitPane
split="vertical"
maxSize={MaxSize * 0.965}
defaultSize="50%"
onChange={() => {
setIsOverlayVisible(true);
Expand Down