From 757a5fb5b75079927dbebf5848466166cf245dac Mon Sep 17 00:00:00 2001 From: Nico Date: Wed, 3 Jun 2026 15:12:49 -0700 Subject: [PATCH] fix: close map object settings --- frontend/src/components/maps/LocationMapBottomSheet.jsx | 2 ++ frontend/src/pages/LocationMapManager.jsx | 1 + frontend/tests/location-map-manager.spec.ts | 4 ++++ 3 files changed, 7 insertions(+) diff --git a/frontend/src/components/maps/LocationMapBottomSheet.jsx b/frontend/src/components/maps/LocationMapBottomSheet.jsx index dcceee0..883a3dc 100644 --- a/frontend/src/components/maps/LocationMapBottomSheet.jsx +++ b/frontend/src/components/maps/LocationMapBottomSheet.jsx @@ -42,6 +42,7 @@ export default function LocationMapBottomSheet({ onEditMode, onObjectField, onZoneLinkChange, + onClearSelection, onDuplicateObject, onDeleteObject, }) { @@ -234,6 +235,7 @@ export default function LocationMapBottomSheet({
+
diff --git a/frontend/src/pages/LocationMapManager.jsx b/frontend/src/pages/LocationMapManager.jsx index dad093c..3806e17 100644 --- a/frontend/src/pages/LocationMapManager.jsx +++ b/frontend/src/pages/LocationMapManager.jsx @@ -529,6 +529,7 @@ export default function LocationMapManager() { onEditMode={handleEditMode} onObjectField={handleObjectField} onZoneLinkChange={handleZoneLinkChange} + onClearSelection={() => setSelectedObjectKey(null)} onDuplicateObject={handleDuplicateObject} onDeleteObject={requestDeleteObject} /> diff --git a/frontend/tests/location-map-manager.spec.ts b/frontend/tests/location-map-manager.spec.ts index f85c5f8..b94cae4 100644 --- a/frontend/tests/location-map-manager.spec.ts +++ b/frontend/tests/location-map-manager.spec.ts @@ -914,6 +914,10 @@ test("mobile editor uses bottom sheet controls instead of desktop object toolbar await expect(page.getByRole("button", { name: "Objects" })).toHaveClass(/active/); await page.locator(".location-map-object", { hasText: "Bakery" }).locator("rect").first().click(); await expect(page.getByRole("textbox", { name: "Label" })).toBeVisible(); + await expect(page.locator(".location-map-sheet-header strong")).toHaveText("Bakery"); + await page.getByRole("button", { name: "Done" }).click(); + await expect(page.getByRole("textbox", { name: "Label" })).toHaveCount(0); + await expect(page.locator(".location-map-sheet-header strong")).toHaveText("Edit Objects"); }); test("members can view a published map but cannot edit it", async ({ page }) => {