Fix bug in channel rendering
Fix drag and drop stale state bug revealed by the channel panel co-authored-by: Max <max@zed.dev>
This commit is contained in:
parent
4ff44dfa3b
commit
f2f507e619
3 changed files with 50 additions and 64 deletions
|
@ -364,9 +364,15 @@ impl<V: 'static> Draggable<V> for MouseEventHandler<V> {
|
|||
DragAndDrop::<D>::drag_started(e, cx);
|
||||
})
|
||||
.on_drag(MouseButton::Left, move |e, _, cx| {
|
||||
let payload = payload.clone();
|
||||
let render = render.clone();
|
||||
DragAndDrop::<D>::dragging(e, payload, cx, render)
|
||||
if e.end {
|
||||
cx.update_global::<DragAndDrop<D>, _, _>(|drag_and_drop, cx| {
|
||||
drag_and_drop.finish_dragging(cx)
|
||||
})
|
||||
} else {
|
||||
let payload = payload.clone();
|
||||
let render = render.clone();
|
||||
DragAndDrop::<D>::dragging(e, payload, cx, render)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue