mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Fix microjump on drag binding, no keyboard move if bound arrow
Signed-off-by: Mark Tolmacs <mark@lazycat.hu>
This commit is contained in:
parent
c3924a8f8c
commit
06b3750a2f
8 changed files with 80 additions and 69 deletions
|
@ -173,7 +173,7 @@ describe("element binding", () => {
|
|||
},
|
||||
);
|
||||
|
||||
it("should unbind arrow when moving it with keyboard", () => {
|
||||
it("should not move bound arrows when moving it with keyboard", () => {
|
||||
const rectangle = UI.createElement("rectangle", {
|
||||
x: 75,
|
||||
y: 0,
|
||||
|
@ -208,16 +208,10 @@ describe("element binding", () => {
|
|||
Keyboard.keyPress(KEYS.ARROW_LEFT);
|
||||
});
|
||||
});
|
||||
expect(arrow.endBinding).toBe(null);
|
||||
|
||||
Keyboard.withModifierKeys({ shift: true }, () => {
|
||||
// We have to move a significant distance to return to the binding
|
||||
Array.from({ length: 10 }).forEach(() => {
|
||||
Keyboard.keyPress(KEYS.ARROW_RIGHT);
|
||||
});
|
||||
});
|
||||
// We are back in the binding zone but we shouldn't rebind
|
||||
expect(arrow.endBinding).toBe(null);
|
||||
expect(arrow.endBinding?.elementId).toBe(rectangle.id);
|
||||
expect(arrow.x).toBe(0);
|
||||
expect(arrow.y).toBe(0);
|
||||
});
|
||||
|
||||
it("should unbind on bound element deletion", () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue