-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Animated placeholders when transitioning between lists #77
Comments
I'd love to help out here as well if possible. If you have any sort of roadmap or ideas for this I can start a PR. I landed on this implementation for now which somewhat works, just need to update the dimensions snapshot somehow: function SortableItem({ id, index, children }) {
return (
<SortableContainerContext.Consumer>
{sortableContainerSnapshot => (
<Draggable draggableId={id} index={index}>
{(provided, snapshot) => (
<div>
<div
ref={provided.innerRef}
{...provided.draggableProps}
{...provided.dragHandleProps}
style={getItemStyle(
snapshot.isDragging,
provided.draggableProps.style
)}
>
{children}
</div>
{provided.placeholder && (
<div
style={{
height: sortableContainerSnapshot.isDraggingOver ? 51 : 0,
transition: 'all 350ms',
}}
>
{provided.placeholder}
</div>
)}
</div>
)}
</Draggable>
)}
</SortableContainerContext.Consumer>
)
} Needs some internal work to clean things up, as well as use React Motion, but pretty cool interaction! Is there anything exposed right now that would allow me to fire a recalculation of dimensions? |
I would love to see this fixed. Any progress on this issue? |
@yogaboll you should be able to measure the DOM node and provide that to the height of a wrapper around |
Thanks, I got it working by measuring the list-item. Unfortunately, this method causes a couple of new visual glitches so I don't think it's worth it for me. |
I am hoping to see if we can get this working as a part of #8 |
Hi @alexreardon, I see #8 was closed. Was this included in that change? I'm still experiencing the snapping placeholders when dragging between lists |
Aye, this has not been fixed - but I hope to after |
hi @alexreardon , I'm trying to fix this in my pull request. Pls take a look to see if I'm doing this right. |
We hope to get onto this soon 😊 |
It seems like I forgot to take scrollable droppable into account... It seems more complicated than I originally thought .... The main purpose of my PR is make the active area as big as when the placeholder is on the droppable. I think the default behavior should be when you drag over a foreign list which doesn't have a scrollbar, the active area should expand to the length(or width depending on droppable direction) of the draggable, but when there's a scrollbar existed already, there's no need to expand the active area. I don't know @alexreardon if you are agreed with this logic. Will update until when we're on the same page. |
Behaviour (wip)Where is the gap?General rule: there should only ever be one gap in all lists to show where a (this is already what we have today)
Animation behaviourHome droppable
Foreign droppable
Dropping
PerformanceIdeally, we render as few |
Note to post-leave @alexreardon In order to overcome unwanted renders put a |
Things still to overcome:
|
Here is a prototype that is showing great potential: https://deploy-preview-1086--react-beautiful-dnd.netlify.com/iframe.html?selectedKind=board&selectedStory=simple&full=0&addons=0&stories=1&panelRight=0 |
It is hard to get looking smooth across many use cases |
Looks great! Very excited for this - keep up the amazing work! 😃 |
This was released in 10.1 |
Hello @alexreardon , where can I get the source code of this sample ? |
When transitioning between lists there is some snapping that occurs:
The goal is to have both of these scenarios animated. However, in order to ship #2 it was decided that this feature was not critical enough to hold up the release. The interaction still feels really nice - it would just be even better with animated placeholders.
The text was updated successfully, but these errors were encountered: