Support for drop targets instead of default sorting behavior
See original GitHub issueHi @clauderic! I am wondering if in your upcoming feature/collision-detection
branch, there is going to be support for optionally overriding the sorting behavior?
In my use case, if a user drops an item in between others, it sorts the list but if the item is dropped on top of another, I can perform a different operation. So, to do this, I would need to know if an item is dropped on top of another (and not calculate new position in this case), or above or below the other (calculate new position in this case).
Let me know your thoughts!
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
About Drop Targets in the Layout Pane - Oracle Help Center
In the Layout pane, the columns in a data view are displayed in drop targets. Drop targets indicate where you can insert, move,...
Read more >WooCommerce: How to Remove the "Default Sorting" Dropdown
To adjust the sort functions in the drop down, I saved both codes of you in Design > Editor > functions.php and style.css...
Read more >Using the HTML5 Drag and Drop API - web.dev
In this post we'll explain the basics of drag and drop. ... default behavior for drops, which is typically some sort of annoying...
Read more >National Guidelines for Behavioral Health Crisis Care
The National Guidelines for Crisis Care – A Best Practice Toolkit advances national guidelines in crisis care within a toolkit that supports ......
Read more >Target groups for your Network Load Balancers
By default, a load balancer routes requests to its targets using the ... Target groups for Network Load Balancers support the following protocols...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I am too looking for something like this. @clauderic do you have any plans for supporting this feature? I can even try helping in PR for this change, I have very minimal POC working for this in my forked repo. Does
collision_detection
branch plan to handle this use case or is it something entirely different?@clauderic @oyeanuj Guys, I have worked on something similar for my use case. It allows users to detect overlaps and act based on overlap detection. Now it passes three arguments to onSortEnd handler,
oldIndex
,newIndex
andmerge
.merge
would be true if there is a an overlap (configurable via mergeThreshold and swapThreshold). I have added few demos as well to the story book. Here are my changes, https://github.com/champeng/react-sortable-hoc/tree/feature/overlap-detection. Please let me know if you guys want me send a PR.