From 34a2b4591607d15cbdf8370f2892c5899bc272b0 Mon Sep 17 00:00:00 2001 From: Jonathan Ayala <13840865+yojona@users.noreply.github.com> Date: Thu, 17 Jun 2021 11:33:41 -0700 Subject: [PATCH] fix: snap to grid (bottom) (#491) fixes issue in #482, snap to the end of the grid vertically --- .../react-moveable/src/react-moveable/ables/snappable/snap.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-moveable/src/react-moveable/ables/snappable/snap.ts b/packages/react-moveable/src/react-moveable/ables/snappable/snap.ts index cb70ccfca..3205bceac 100644 --- a/packages/react-moveable/src/react-moveable/ables/snappable/snap.ts +++ b/packages/react-moveable/src/react-moveable/ables/snappable/snap.ts @@ -408,7 +408,7 @@ export function getGridGuidelines( const guidelines: SnapGuideline[] = []; if (snapGridHeight) { - for (let pos = 0; pos < containerHeight; pos += snapGridHeight) { + for (let pos = 0; pos <= containerHeight; pos += snapGridHeight) { guidelines.push({ type: "horizontal", pos: [0, throttle(pos - clientTop, 0.1)],