Snapgrid vertical/horizontal guidelines relative to a specific container
See original GitHub issueEnvironments
- Framework name: React
- Framework version: Latest
- Moveable Component version: Latest
- Testable Address(optional):
Description
Hello, I’m looking for a way to pass a list of vertical and horizontal guidelines using the snappable able, but make the guidelines relative to the container of the element or a user-specified container. Would it be possible to include a prop like the following:
guidelinesContainer: (selected: (HTMLElement | SVGElement)[]) => HTMLElement
Return value of this would be the container that the guidelines are relative to.
This way when I pass guidelines to verticalGuidelines and horizontalGuidelines, the values can depend on a container other than the container of the react-moveable instance.
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Practical CSS Scroll Snapping
CSS scroll snapping allows you to lock the viewport to certain elements or ... First, we tell the container to snap along its...
Read more >Grid, Guides, and Smart Snapping in Godot 3 (tutorial)
Get a comprehensive overview of Godot's grids and snapping options!Intermediate Godot 3 course: ...
Read more >How to snap shapes positions on dragging with Konva?
How to snap draggable shapes to each other?This demo will demonstrate how to implement snapping of objects to all edges of the stage...
Read more >Set up Snap Grid | User Guide Page - Graphisoft Help Center
Use the controls under Snap Grid/Nudge to define the intervals (horizontal and vertical directions) to which the cursor will snap when Snap Grid...
Read more >FlexContainer
Specifies whether the arrangement of widgets in the FlexContainer flows horizontally, vertically, or in both directions. Default: Vertical. Child Widget Align.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
On second thought, I’m thinking a better way for this would be when passing in verticalGuidelines/horizontalGuidelines, the prop would have the following typing:
type verticalGuidelines = number[] | {container: HTMLElement, value: number}[]
type horizontalGuidelines = number[] | {container: HTMLElement, value: number}[]
This would allow the user to specify the guideline relative to a particular container before hand. My use case is that I have a single moveable instance managing the components on multiple “pages” but these pages can be zoomed in and out. Since the moveable instance currently lives outside of the pages, the vertical guidelines have to be changed every time the zoom of the page is changed
No problem, i think this should help me accomplish what I was trying to do. Thanks! works great.