clauderic / clauderic/react-sortable-hoc

Using react-sortable-hoc to sort rows in CSS grid with Drag Handle

Open
#732 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
10.9k
Forks
959
PR merge metrics
No merged PRs in 30d

Description

I'm trying to use react-sortable-hoc to sort rows in a CSS grid. In order for the grid to layout, all the grid cells must be direct descendants of the grid element. Good resource on this is https://css-tricks.com/snippets/css/complete-guide-grid/

E.g.,
```



column 1

column 2


column 1

column 2


```

Because of this, my SortableElement has to be a Fragment which returns the elements without a row container. However when I do this and drag from the draghandle, the ghost element shows only the drag handle and not the other elements which were inside the fragment.

Is there anything I can do to get around this?

https://codesandbox.io/s/polished-river-8mvng?file=/src/index.js

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the provided CodeSandbox reproduction at src/index.js and verify how the fragment-based SortableElement behaves when dragging from its handle. Read the reproduction and react-sortable-hoc's drag-ghost behavior first; done means the dragged ghost includes all grid cells while preserving the CSS grid's direct-child structure.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend, web-dev
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.