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 working on a page builder. I have some requirements (in comments).
Is it justified to use this structure, or is there a simpler solution without nested DndContexts?
// 'DraggableItem' can be dragged into the 'SortableSection'.
<DndContext>
<Sidebar>
<DraggableItem />
...
</Sidebar>
// The 'SortableSection' can only be moved up and down.
<DndContext collisionDetection={closestCenter} modifiers={[restrictToVerticalAxis]}>
<SortableContext strategy={verticalListSortingStrategy}>
<SortableSection>
// The 'SortableSectionColumn' can't be moved outside its parent element.
<DndContext collisionDetection={closestCenter} modifiers={[restrictToParentElement]}>
<SortableContext strategy={rectSwappingStrategy}>
<SortableSectionColumn>
<SectionColumn>
// The 'DraggableComponent' can be moved into any 'SectionColumn'.
<DraggableComponent />
...
</SectionColumn>
</SortableSectionColumn>
...
</SortableContext>
</DndContext>
</SortableSection>
...
</SortableContext>
</DndContext>
</DndContext>
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm working on a page builder. I have some requirements (in comments).
Is it justified to use this structure, or is there a simpler solution without nested DndContexts?
Beta Was this translation helpful? Give feedback.
All reactions