-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wide Draggable cannot be dropped on another list #978
Comments
I have this problem in a complex DnD layout, something like a file manager, think Mac Finder or Windows Explorer. A solution to #981 (resize on drag) would fix this issue, also making the mouse drag point be the 'center of gravity' would fix it. I understand the point about making RBDnD model the physical world, but in my experience that idea does not fit the screen world and servers no real purpose. I realize that I could use another DnD library that works more the way I want, but I have looked at several and RBDnD is far and away superior to the others. Having this ability would make it just about perfect! |
Yes, looking again at the documentation, it seems that my request has faced the roadblock of Application 2: knowing when to move. However, at this point, I would like to question the correctness of this principle. For instance, it certainly makes sense to do so when dragging from one list to another from left to right in the case of having a drag handle on the left - see my example. However, when dragging from right to left, it makes the setup in my example rather unusable. Another example where judging the entry to a Yes, I know, in theory, the So, to wrap up, I would imagine there could be a prop on I've never done a PR, but - if this project even accepts PRs - I'd be happy to give it a go with some help and pointers on where to start. |
I ran into this problem as well. I'm using semantic-ui-react. When I realized that the reason the draggables couldn't be dropped was the calculation based on their width, I tried many things to adjust the draggable width down so that the midpoint could cross the droppable on the screen. Applying styles, etc was unsuccessful. My current solution is to put the droppable into a grid column with a width of '1'. The draggables will still render at the width dictated by the draggable component, in this case the text in the label object, but the width used for calculating whether the midpoint is over the droppable (which is taken from the Grid.Column width) is small enough that you can target e.g. a droppable near the edge of the screen. This does lead to weird looking problems with wider draggables & other edge cases, but mostly works well enough that I have not had to drop rdndb.
|
Related: #930 |
We will track this here: #930 |
Bug or feature request?
Perhaps both
Expected behavior
I would expect the Draggable to be recognized by a Droppable when the part by which it is dragged enters the Droppable.
Actual behavior
I understand that the current implementation expects the middle point of the Draggable to enter the Droppable for the drop to become available. In most cases this is OK. However, if, say, there are 2 lists, and one of them contains very wide Draggables, it's nearly impossible to drop those Draggables onto another Droppable.
I say nearly impossible because it is possible if I drag outside of container bounds. However, this is not always possible, say, when this would require to drag outside of screen bounds.
Steps to reproduce
In the demo, try dragging an item from the left-hand list onto the right-hand one - it works. Now, try to drag in the opposite direction - it doesn't, because the center point of the item never reaches the boundaries of the left-hand list.
What version of
React
are you using?16.6.3
What version of
react-beautiful-dnd
are you running?10.0.2
What browser are you using?
Firefox 63.0.3 Mac
Demo
https://codesandbox.io/s/4zmvl6k4q4
The text was updated successfully, but these errors were encountered: