diff --git a/cypress/e2e/layers.cy.ts b/cypress/e2e/layers.cy.ts index a3d47074..26813dd1 100644 --- a/cypress/e2e/layers.cy.ts +++ b/cypress/e2e/layers.cy.ts @@ -97,8 +97,26 @@ describe("layers", () => { }); }); }); + + describe("when selecting a layer", () => { + let secondId: string; + beforeEach(() => { + when.modal.open(); + secondId = when.modal.fillLayers({ + id: "second-layer", + type: "background", + }); + }); + it("should show the selected layer in the editor", () => { + when.realClick("layer-list-item:" + secondId); + then(get.elementByTestId("layer-editor.layer-id.input")).shouldHaveValue(secondId); + when.realClick("layer-list-item:" + id); + then(get.elementByTestId("layer-editor.layer-id.input")).shouldHaveValue(id); + }); + }); }); }); + describe("background", () => { it("add", () => { const id = when.modal.fillLayers({ diff --git a/src/components/LayerList.tsx b/src/components/LayerList.tsx index 3de16c58..dc382526 100644 --- a/src/components/LayerList.tsx +++ b/src/components/LayerList.tsx @@ -336,7 +336,7 @@ type LayerListProps = LayerListContainerProps & { }; const LayerList: React.FC = (props) => { - const sensors = useSensors(useSensor(PointerSensor)); + const sensors = useSensors(useSensor(PointerSensor, { activationConstraint: { distance: 5 } })); const handleDragEnd = (event: DragEndEvent) => { const {active, over} = event;