fix: correct SortableContext nesting for table drag-and-drop (#263)

## Summary
- Fixed incorrect nesting of SortableContext component in forward table
- Moved SortableContext wrapper to properly wrap the entire Table
component instead of wrapping individual rows
- This ensures drag-and-drop functionality works correctly with the
table structure
This commit is contained in:
sagit
2026-03-04 16:01:38 +08:00
committed by GitHub
+5 -6
View File
@@ -3788,6 +3788,10 @@ export default function ForwardPage() {
collisionDetection={closestCenter}
sensors={sensors}
onDragEnd={handleDragEnd}
>
<SortableContext
items={sortableForwardIds}
strategy={verticalListSortingStrategy}
>
<Table
aria-label="全部转发列表"
@@ -3814,11 +3818,6 @@ export default function ForwardPage() {
</TableHeader>
<TableBody emptyContent="暂无转发配置" items={sortedForwards}>
{(forward) => (
<SortableContext
key={forward.id}
items={sortableForwardIds}
strategy={verticalListSortingStrategy}
>
<SortableCompactTableRow
formatFlow={formatFlow}
formatInAddress={formatInAddress}
@@ -3835,10 +3834,10 @@ export default function ForwardPage() {
showAddressModal={showAddressModal}
toggleSelect={toggleSelect}
/>
</SortableContext>
)}
</TableBody>
</Table>
</SortableContext>
</DndContext>
</div>
) : (