You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm developing a Layout component that positions subcomponents horizontally and supports flex "justify-content" and "align-items." The rendering portion works great, but editing only supports adding and displaying components vertically. The underlying "dnd" library supports a horizontal direction.
It would be great if DropZone allowed specifying a horizontal direction. Support for flex positioning would be icing on the cake.
The text was updated successfully, but these errors were encountered:
I found a solution that works great for me. I've found that if you pass a "style" prop (undocumented) to DropZone, it's passed on to the container for all of the draggable children. So I do this:
This lays out the children horizontally within the drop zone. I can specify any justify-content value, such as 'space-between'.
However, when dropping onto the drop zone, it still does it vertically, so I patched Puck to fix this. The file is: node_modules/@measured/puck/dist/index.js. For my version, the line number is 31374 where I replaced direction: "vertical" with direction: style?.display === "flex" ? "horizontal" : "vertical". So when flex display is specified, it uses a horizontal drag and drop.
The patch works for editing, but not when rendering. The solution that works for me is to wrap the <DropZone .../> in a div with { display: 'flex', justifyContent: justify }.
I'm developing a Layout component that positions subcomponents horizontally and supports flex "justify-content" and "align-items." The rendering portion works great, but editing only supports adding and displaying components vertically. The underlying "dnd" library supports a horizontal direction.
It would be great if DropZone allowed specifying a horizontal direction. Support for flex positioning would be icing on the cake.
The text was updated successfully, but these errors were encountered: