resize snap to grid relative to dragged edge location
See original GitHub issueI’m using react-rnd version [7.1.4]
First up, thanks so much for maintaining and developing this component. It has been fantastic and really intuitive to work with 😃
I have an issue that I can’t seem to resolve though: I am rendering rnd components in various locations on my page and have enabled resizing in left and right directions and set them snap to a resizeGrid: [40, 0]. My desired behaviour is that when resizing I want the resize to snap to 40px to the left or right of the resized edge original location, however I’m finding that resizing is snapping to a global grid starting from the edge of the browser window.
So lets say I have an rnd component located with the right edge at 135px from the edge of browser window. When I drag to the right I want the next snap point to be at 135 + 40 = 175px, but instead I am finding that the first snap point is 160px.
Is there a way for resize grid to be relative to the location of the edge being dragged instead of a global grid?
Thanks 😃
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:7 (2 by maintainers)

Top Related StackOverflow Question
@oldo Sorry. I have not started yet…
Thanks @bokuweb
Let me know if there is anything I can do down my end 😃