This commit is contained in:
dwelle
2025-11-18 20:48:07 +01:00
parent 3ee618497c
commit 39a8bcb3a4
4 changed files with 22 additions and 8 deletions

View File

@@ -1192,7 +1192,7 @@ const ExcalidrawWrapper = () => {
</div>
);
}}
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() && (
<ConstraintsSettings
excalidrawAPI={excalidrawAPI}
initialConstraints={constraints}
/>
)}
)} */}
<AppMainMenu
onCollabDialogOpen={onCollabDialogOpen}
isCollaborating={isCollaborating}

View File

@@ -125,7 +125,10 @@ const ExcalidrawBase = (props: ExcalidrawProps) => {
renderTopLeftUI={renderTopLeftUI}
renderTopRightUI={renderTopRightUI}
langCode={langCode}
viewModeEnabled={viewModeEnabled ?? !!scrollConstraints}
viewModeEnabled={
viewModeEnabled ??
(scrollConstraints != null ? !!scrollConstraints : undefined)
}
zenModeEnabled={zenModeEnabled}
gridModeEnabled={gridModeEnabled}
libraryReturnUrl={libraryReturnUrl}

View File

@@ -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,

View File

@@ -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", () => {