From 39a8bcb3a4378aad705db9904496b90c8c51b7d0 Mon Sep 17 00:00:00 2001
From: dwelle <5153846+dwelle@users.noreply.github.com>
Date: Tue, 18 Nov 2025 20:48:07 +0100
Subject: [PATCH] green
---
excalidraw-app/App.tsx | 6 +++---
packages/excalidraw/index.tsx | 5 ++++-
.../tests/__snapshots__/history.test.tsx.snap | 5 +++++
packages/excalidraw/tests/contextmenu.test.tsx | 14 ++++++++++----
4 files changed, 22 insertions(+), 8 deletions(-)
diff --git a/excalidraw-app/App.tsx b/excalidraw-app/App.tsx
index bbb74ada56..126ee44341 100644
--- a/excalidraw-app/App.tsx
+++ b/excalidraw-app/App.tsx
@@ -1192,7 +1192,7 @@ const ExcalidrawWrapper = () => {
);
}}
- scrollConstraints={constraints.enabled ? constraints : undefined}
+ // scrollConstraints={constraints.enabled ? constraints : undefined}
onLinkOpen={(element, event) => {
if (element.link && isElementLink(element.link)) {
event.preventDefault();
@@ -1200,12 +1200,12 @@ const ExcalidrawWrapper = () => {
}
}}
>
- {excalidrawAPI && !isTestEnv() && (
+ {/* {excalidrawAPI && !isTestEnv() && (
- )}
+ )} */}
{
renderTopLeftUI={renderTopLeftUI}
renderTopRightUI={renderTopRightUI}
langCode={langCode}
- viewModeEnabled={viewModeEnabled ?? !!scrollConstraints}
+ viewModeEnabled={
+ viewModeEnabled ??
+ (scrollConstraints != null ? !!scrollConstraints : undefined)
+ }
zenModeEnabled={zenModeEnabled}
gridModeEnabled={gridModeEnabled}
libraryReturnUrl={libraryReturnUrl}
diff --git a/packages/excalidraw/tests/__snapshots__/history.test.tsx.snap b/packages/excalidraw/tests/__snapshots__/history.test.tsx.snap
index e46fcba59e..d61f608a6b 100644
--- a/packages/excalidraw/tests/__snapshots__/history.test.tsx.snap
+++ b/packages/excalidraw/tests/__snapshots__/history.test.tsx.snap
@@ -12537,6 +12537,7 @@ exports[`history > singleplayer undo/redo > should create new history entry on e
},
"previousSelectedElementIds": {},
"resizingElement": null,
+ "scrollConstraints": null,
"scrollX": 0,
"scrollY": 0,
"searchMatches": null,
@@ -12746,6 +12747,7 @@ exports[`history > singleplayer undo/redo > should create new history entry on e
},
"previousSelectedElementIds": {},
"resizingElement": null,
+ "scrollConstraints": null,
"scrollX": 0,
"scrollY": 0,
"searchMatches": null,
@@ -12958,6 +12960,7 @@ exports[`history > singleplayer undo/redo > should create new history entry on i
},
"previousSelectedElementIds": {},
"resizingElement": null,
+ "scrollConstraints": null,
"scrollX": 0,
"scrollY": 0,
"searchMatches": null,
@@ -13258,6 +13261,7 @@ exports[`history > singleplayer undo/redo > should create new history entry on i
},
"previousSelectedElementIds": {},
"resizingElement": null,
+ "scrollConstraints": null,
"scrollX": 0,
"scrollY": 0,
"searchMatches": null,
@@ -15599,6 +15603,7 @@ exports[`history > singleplayer undo/redo > should not modify anything on unrela
},
"previousSelectedElementIds": {},
"resizingElement": null,
+ "scrollConstraints": null,
"scrollX": 0,
"scrollY": 0,
"searchMatches": null,
diff --git a/packages/excalidraw/tests/contextmenu.test.tsx b/packages/excalidraw/tests/contextmenu.test.tsx
index 5bb7fee8e1..76a01d2889 100644
--- a/packages/excalidraw/tests/contextmenu.test.tsx
+++ b/packages/excalidraw/tests/contextmenu.test.tsx
@@ -100,12 +100,18 @@ describe("contextMenu element", () => {
];
expect(contextMenu).not.toBeNull();
- expect(contextMenuOptions?.length).toBe(expectedShortcutNames.length);
expectedShortcutNames.forEach((shortcutName) => {
- expect(
- contextMenu?.querySelector(`li[data-testid="${shortcutName}"]`),
- ).not.toBeNull();
+ try {
+ expect(
+ contextMenu?.querySelector(`li[data-testid="${shortcutName}"]`),
+ ).not.toBeNull();
+ } catch (err) {
+ throw new Error(
+ `Failed to find context menu item with test id: ${shortcutName}`,
+ );
+ }
});
+ expect(contextMenuOptions?.length).toBe(expectedShortcutNames.length);
});
it("shows context menu for element", () => {