Skip to content

Commit 736dd70

Browse files
committed
hotfix: MQ for laptops
1 parent 1f02022 commit 736dd70

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

packages/common/src/constants.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,9 @@ export const DEFAULT_UI_OPTIONS: AppProps["UIOptions"] = {
359359
// mobile: up to 699px
360360
export const MQ_MAX_MOBILE = 800;
361361

362+
export const MQ_MAX_WIDTH_LANDSCAPE = 1000;
363+
export const MQ_MAX_HEIGHT_LANDSCAPE = 500;
364+
362365
// tablets
363366
export const MQ_MIN_TABLET = MQ_MAX_MOBILE + 1; // lower bound (excludes phones)
364367
export const MQ_MAX_TABLET = 1400; // upper bound (excludes laptops/desktops)

packages/excalidraw/components/App.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ import {
104104
MQ_MIN_TABLET,
105105
MQ_MAX_TABLET,
106106
isProdEnv,
107+
MQ_MAX_HEIGHT_LANDSCAPE,
108+
MQ_MAX_WIDTH_LANDSCAPE,
107109
} from "@excalidraw/common";
108110

109111
import {
@@ -2446,8 +2448,10 @@ class App extends React.Component<AppProps, AppState> {
24462448
};
24472449

24482450
private isMobileBreakpoint = (width: number, height: number) => {
2449-
const minSide = Math.min(width, height);
2450-
return minSide <= MQ_MAX_MOBILE;
2451+
return (
2452+
width <= MQ_MAX_MOBILE ||
2453+
(height < MQ_MAX_HEIGHT_LANDSCAPE && width < MQ_MAX_WIDTH_LANDSCAPE)
2454+
);
24512455
};
24522456

24532457
private isTabletBreakpoint = (editorWidth: number, editorHeight: number) => {

0 commit comments

Comments
 (0)