mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-25 18:31:15 +02:00
fix: reintroduce height-based mobile query detection (#10020)
This commit is contained in:
@@ -354,6 +354,9 @@ export const DEFAULT_UI_OPTIONS: AppProps["UIOptions"] = {
|
|||||||
// mobile: up to 699px
|
// mobile: up to 699px
|
||||||
export const MQ_MAX_MOBILE = 599;
|
export const MQ_MAX_MOBILE = 599;
|
||||||
|
|
||||||
|
export const MQ_MAX_WIDTH_LANDSCAPE = 1000;
|
||||||
|
export const MQ_MAX_HEIGHT_LANDSCAPE = 500;
|
||||||
|
|
||||||
// tablets
|
// tablets
|
||||||
export const MQ_MIN_TABLET = MQ_MAX_MOBILE + 1; // lower bound (excludes phones)
|
export const MQ_MIN_TABLET = MQ_MAX_MOBILE + 1; // lower bound (excludes phones)
|
||||||
export const MQ_MAX_TABLET = 1400; // upper bound (excludes laptops/desktops)
|
export const MQ_MAX_TABLET = 1400; // upper bound (excludes laptops/desktops)
|
||||||
|
@@ -103,6 +103,8 @@ import {
|
|||||||
MQ_MAX_MOBILE,
|
MQ_MAX_MOBILE,
|
||||||
MQ_MIN_TABLET,
|
MQ_MIN_TABLET,
|
||||||
MQ_MAX_TABLET,
|
MQ_MAX_TABLET,
|
||||||
|
MQ_MAX_HEIGHT_LANDSCAPE,
|
||||||
|
MQ_MAX_WIDTH_LANDSCAPE,
|
||||||
} from "@excalidraw/common";
|
} from "@excalidraw/common";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@@ -2423,8 +2425,10 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
private isMobileBreakpoint = (width: number, height: number) => {
|
private isMobileBreakpoint = (width: number, height: number) => {
|
||||||
const minSide = Math.min(width, height);
|
return (
|
||||||
return minSide <= MQ_MAX_MOBILE;
|
width <= MQ_MAX_MOBILE ||
|
||||||
|
(height < MQ_MAX_HEIGHT_LANDSCAPE && width < MQ_MAX_WIDTH_LANDSCAPE)
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
private isTabletBreakpoint = (editorWidth: number, editorHeight: number) => {
|
private isTabletBreakpoint = (editorWidth: number, editorHeight: number) => {
|
||||||
|
Reference in New Issue
Block a user