fix: reintroduce height-based mobile query detection (#10020)

This commit is contained in:
David Luzar
2025-09-24 18:17:39 +02:00
committed by GitHub
parent 00ae455873
commit f738b74791
2 changed files with 9 additions and 2 deletions

View File

@@ -354,6 +354,9 @@ export const DEFAULT_UI_OPTIONS: AppProps["UIOptions"] = {
// mobile: up to 699px
export const MQ_MAX_MOBILE = 599;
export const MQ_MAX_WIDTH_LANDSCAPE = 1000;
export const MQ_MAX_HEIGHT_LANDSCAPE = 500;
// tablets
export const MQ_MIN_TABLET = MQ_MAX_MOBILE + 1; // lower bound (excludes phones)
export const MQ_MAX_TABLET = 1400; // upper bound (excludes laptops/desktops)

View File

@@ -103,6 +103,8 @@ import {
MQ_MAX_MOBILE,
MQ_MIN_TABLET,
MQ_MAX_TABLET,
MQ_MAX_HEIGHT_LANDSCAPE,
MQ_MAX_WIDTH_LANDSCAPE,
} from "@excalidraw/common";
import {
@@ -2423,8 +2425,10 @@ class App extends React.Component<AppProps, AppState> {
};
private isMobileBreakpoint = (width: number, height: number) => {
const minSide = Math.min(width, height);
return minSide <= MQ_MAX_MOBILE;
return (
width <= MQ_MAX_MOBILE ||
(height < MQ_MAX_HEIGHT_LANDSCAPE && width < MQ_MAX_WIDTH_LANDSCAPE)
);
};
private isTabletBreakpoint = (editorWidth: number, editorHeight: number) => {