-
Notifications
You must be signed in to change notification settings - Fork 975
Implemented dragging prop in SortableElement #147
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
base: master
Are you sure you want to change the base?
Conversation
I've updated SortableElement to inject the `isDragging` prop into the WrappedComponent. I've also changed the SortableContainer to allow the SortableElement to re-render before making a clone by making a clone after the state change has been performed.
Hmm, hadn't considered that approach. Have you tested alongside the I actually wonder if we couldn't try using |
@clauderic no I haven't tried that yet. I'll do that tomorrow. The callback of |
Hmm. It's unstable in the sense that the API may change in future releases, but it is still the preferred way of rendering a component subtree into a different container. |
Do you want me to try to implement the Edit: I took a look at how the implementation works from within React. You could probably use the So I don't mind using the |
`isDragging` prop now also takes into account the `collection` prop.
I've updated the PR to also take into account the |
Resolved conflicts. |
@clauderic do you have any intention to merge this? Otherwise I will close this.. |
Hey @clauderic, any news on this? |
+1 on this. I have also wanted to keep track of whether an element was being dragged and soon discovered that the element is cloned before it re renders. This feels like an elegant solution. |
Can this PR get another look? It seems useful for large components. |
Changing some styles by dragging would be very helpful. Can you update the PR? |
@clauderic Hey, is there any chance that this can be merged soon? We would like to give focus-like styles to the dragged component which appears to be impossible at the moment. Edit 1: |
I've updated SortableElement to inject the
isDragging
prop into the WrappedComponent. I've also changed the SortableContainer to allow the SortableElement to re-render before making a clone by making a clone after the state change has been performed.