Fix single element bounding box bug (#2008)

Co-authored-by: Michal Srb <xixixao@seznam.cz>
Co-authored-by: dwelle <luzar.david@gmail.com>
This commit is contained in:
João Forja 2020-08-11 11:42:08 +01:00 committed by GitHub
parent a96406f505
commit 296e3677cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 189 additions and 15 deletions

View file

@ -1212,4 +1212,14 @@ describe("regression tests", () => {
expect(h.elements[0].groupIds).toHaveLength(0);
expect(h.elements[1].groupIds).toHaveLength(0);
});
it("keeps selected element selected when click hits element bounding box but doesn't hit the element", () => {
clickTool("ellipse");
mouse.down(0, 0);
mouse.up(100, 100);
// click on bounding box but not on element
mouse.click(0, 0);
expect(getSelectedElements().length).toBe(1);
});
});