diff --git a/v3/cypress/e2e/adornments.spec.ts b/v3/cypress/e2e/adornments.spec.ts index a3e8b9a15e..689b3c2a15 100644 --- a/v3/cypress/e2e/adornments.spec.ts +++ b/v3/cypress/e2e/adornments.spec.ts @@ -122,7 +122,7 @@ context("Graph adornments", () => { cy.get("[data-testid=graph-adornments-grid]") .find("[data-testid=graph-adornments-grid__cell]").should("have.length", 1) cy.get("[data-testid=adornment-wrapper]").should("have.length", 1) - cy.get("[data-testid=adornment-wrapper]").should("have.class", "fadeIn") + cy.get("[data-testid=adornment-wrapper]").should("have.class", "visible") cy.get("[data-testid=graph-adornments-grid]").find("*[data-testid^=movable-value]").should("exist") cy.get(".movable-value-label").should("have.length", 1) cy.get(".movable-value-fill").should("have.length", 0) @@ -140,7 +140,7 @@ context("Graph adornments", () => { cy.wait(250) movableValueButton.click() cy.get("[data-testid=adornment-button-movable-value--remove]").click() - cy.get("[data-testid=adornment-wrapper]").should("have.class", "fadeOut") + cy.get("[data-testid=adornment-wrapper]").should("have.class", "hidden") cy.get(".movable-value-label").should("have.length", 0) cy.get(".movable-value-fill").should("have.length", 0) }) diff --git a/v3/src/components/graph/adornments/movable-value/movable-value-model.test.ts b/v3/src/components/graph/adornments/movable-value/movable-value-model.test.ts index 13f5da81c8..fdbae9240a 100644 --- a/v3/src/components/graph/adornments/movable-value/movable-value-model.test.ts +++ b/v3/src/components/graph/adornments/movable-value/movable-value-model.test.ts @@ -42,7 +42,7 @@ describe("MovableValueModel", () => { movableValue.setInitialValue(5, "{}") movableValue.addValue(10) movableValue.addValue(2) - movableValue.updateDrag(7, 0, "{}") + movableValue.updateDrag(7, "{}", 0) expect(movableValue.valuesForKey("{}")).toEqual([7, 10, 2]) movableValue.endDrag(7, "{}", 0) expect(movableValue.valuesForKey("{}")).toEqual([7, 10, 2]) @@ -52,7 +52,7 @@ describe("MovableValueModel", () => { movableValue.setInitialValue(5, "{}") movableValue.addValue(10) movableValue.addValue(2) - movableValue.updateDrag(7, 0, "{}") + movableValue.updateDrag(7, "{}", 0) expect(movableValue.sortedValues("{}")).toEqual([2, 7, 10]) movableValue.endDrag(7, "{}", 0) expect(movableValue.sortedValues("{}")).toEqual([2, 7, 10]) diff --git a/v3/src/components/graph/adornments/movable-value/movable-value-model.ts b/v3/src/components/graph/adornments/movable-value/movable-value-model.ts index 417f0dec02..aa369182ae 100644 --- a/v3/src/components/graph/adornments/movable-value/movable-value-model.ts +++ b/v3/src/components/graph/adornments/movable-value/movable-value-model.ts @@ -101,9 +101,9 @@ export const MovableValueModel = AdornmentModel self.values.set(key, []) self.addValue(aValue) }, - updateDrag(value: number, index: number, key: string) { + updateDrag(value: number, instanceKey: string, index: number) { self.dragIndex = index - self.dragKey = key + self.dragKey = instanceKey self.dragValue = value }, endDrag(value: number, instanceKey: string, index: number) { diff --git a/v3/src/components/graph/adornments/movable-value/movable-value.tsx b/v3/src/components/graph/adornments/movable-value/movable-value.tsx index 524f973805..6ec51b4591 100644 --- a/v3/src/components/graph/adornments/movable-value/movable-value.tsx +++ b/v3/src/components/graph/adornments/movable-value/movable-value.tsx @@ -145,7 +145,7 @@ export const MovableValue = observer(function MovableValue (props: IProps) { if ((preDragValue != null) && (newValue < axisMin || newValue > axisMax)) { newValue = preDragValue } - model.updateDrag(newValue, index, instanceKey) + model.updateDrag(newValue, instanceKey, index) refreshValue(newValue, index) }, [getValues, instanceKey, model, refreshValue, xAttrType, xCellCount, xScale, yCellCount, yScale])