-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Remove placeholder from API once upgraded to React 16 #8
Comments
Now that React 16 is released, is someone working on this, or do you need someone to take it on? |
The original plan is to ensure that the current api works with React 15 and React 16. I have already checked so all should be good 🤞 . After that we can make the jump to leaning on the React 16 children behaviour. This will need to be a planned move though as it will break React 15 users. We may try to find a way to still be compatible with React 15 - but we'll see how we go. |
I spiked implementing this as a layer on top of react-beautiful-dnd, and all seemed well at first, but I eventually ran into some wrinkles when trying to use The current API is nice because you have control over how refs are wired, and can choose to support I think this would be a problem when using something like styled-components, as you would need to wire up I'd be interested in hearing how other people go with this, maybe I just made a mistake somewhere… |
hey @alexreardon, do you have any expected date to have the react 16 compatible version? Thanks a lot and congrats for such a great work :) |
Thank you. It should be compatible now. This issue regards cleaning up a part of the api to make it more friendly for react 16. However, doing this will mean that it will not be compatible will react 15 any more. For now we won’t change it, but will probably will in the coming months |
Hello, will this change allow me to use a dropabble that is also a draggable with no extra markup? My idea is deeply nested elements (root -> parents -> children -> grand-children) where everything is sortable (I can sort grand-children in children, but I can also sort children in parents and parents in root). As far as I understand, I cannot do something like:
because my parent would have to be reffed twice, both by draggable's and droppable's innerRef. Is this going to be possible? I can't use extra divs because of styles... |
I'd love to see |
We will not be moving to |
But we are still planning on removing the placeholder from the |
New
|
The draw back to this change is that there is less control over where the placeholder is placed in the React tree. It will now always be a sibling of the The alternative is to provide the placeholder and put the mandate on the consumer to manage I think that this api change should not be a problem for consumers - but it might be a minor cause of friction when upgrading. |
/cc @bradleyayers @souporserious ^ |
This can be a problem for our usage in draggable table. Pseudo code:
We wrapped Do you think that it is possible to switch to new API by default, but also leave the possibility to specify position of placeholder if needed? :) |
We are giving a lot of love to tables in this upgrade ❤️ Firstly, you no longer need to worry about a placeholder being a Tables are also getting their own guide. The guide will explain how you can maintain the dimensions of everything while you are dragging. Here is one of the table examples we have put together: table example. It is not the most performant on lift but it is fine for <80 items. For high performance needs we are putting together some other examples. |
Closed by #406 |
Retracting control over placeholder rendering should be fine for how we're using it in Dovetail. We're not doing anything funky so I'm expecting it will "just work". |
Are custom Draggable placeholders no longer going to be supported? |
Custom Draggable placeholders are no longer supported... is there any alternative? |
Droppable API
Proposed change: rather that requiring the consumer to bind the ref - use ReactDOM.find(this) to get the DOM node.
New usage
Draggable API
The text was updated successfully, but these errors were encountered: