Add drag and drop support to list view
Describe the problem feature solves On the list view, I would like to allow people to reorder items via drag and drop. This currently is not supported.
Describe the solution you'd like I would like to see an option that would allow users to reorder items in a list via drag and drop. I understand the challenges with pagination. Other tools solve this by disabling pagination and instead load additional records when the user scrolls to the bottom of the page. Drag and drop only makes sense in lists that have a reasonable amount of items anyway, so it would be up to us to decide when to use it.
Describe alternatives you've considered I currently have a position number field on the edit page that the user must manually change.
Acceptance criteria NA
We won't be able to do it in a short time. This hasn't been requested very often (to be honest it's 3rd time I've seen someone ask about this feature).
Our frontend is currently being rewritten and separated to another repository so we're avoiding writing new features that we'll have to move there later anyway, I mostly maintain and fix issues found in the current implementation.
For now you can achieve this by writing your own custom component for list action which wraps all elements with @react-forked/dnd or a different drag n' drop library.
I'll leave some extra notes on how we can add this feature later though.
- Add a new action called
ordered-list.
- Data fetching should work similarly to
list - There should be a handler which allows you to change the position of an element.
- The handler should run a database query which reorders all affected records. We must implement a proper function for all adapters that we support. This might have performance impact on large tables.
- Write a component for
ordered-list:
- Either a drag and drop OR up/down arrows next to list elements.
- Pagination on scroll effect
Gotcha. Ok, thanks for the help. Yes, this is a big one so I could see this being a new type of component and possibly in a separate repo like the upload module. Do you want to leave it open or close it?