Add store location map manager #20
@ -146,6 +146,13 @@ export default function LocationMapCanvas({
|
||||
};
|
||||
|
||||
const handleObjectKeyDown = (event, object) => {
|
||||
if (event.key === "Escape" && (mode === "view" || canEditObjects)) {
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
setSelectedObjectKey(null);
|
||||
return;
|
||||
}
|
||||
|
||||
if (["Enter", " ", "Spacebar"].includes(event.key)) {
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
|
||||
@ -2541,6 +2541,12 @@ test("viewer map areas are keyboard selectable", async ({ page }) => {
|
||||
await expect(bakeryArea).toHaveAttribute("aria-pressed", "false");
|
||||
await expect(page.locator(".location-map-sheet-header strong")).toHaveText("Frozen Foods");
|
||||
await expect(page.locator(".location-map-sheet-count")).toHaveText("0 shown");
|
||||
|
||||
await page.keyboard.press("Escape");
|
||||
await expect(frozenArea).toBeFocused();
|
||||
await expect(frozenArea).toHaveAttribute("aria-pressed", "false");
|
||||
await expect(page.locator(".location-map-sheet-header strong")).toHaveText("Map Details");
|
||||
await expect(page.getByLabel("Map summary")).toBeVisible();
|
||||
});
|
||||
|
||||
test("mobile fit zoom fits the map into the visible canvas", async ({ page }) => {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user