question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for drop targets instead of default sorting behavior

See original GitHub issue

Hi @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:closed
  • Created 7 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
champengcommented, May 3, 2017

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?

1reaction
champengcommented, Jun 27, 2017

@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 and merge. 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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found