Fix channel move cancel (#3004)

Release Notes:

- Fixes a bug where channels could no longer be rearranged with drag and
drop.
This commit is contained in:
Max Brunsfeld 2023-09-21 09:11:09 -07:00 committed by GitHub
commit 19a9753663
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -611,9 +611,10 @@ impl<'a> WindowContext<'a> {
} }
Event::MouseUp(e) => { Event::MouseUp(e) => {
// NOTE: The order of event pushes is important! MouseUp events MUST be fired mouse_events.push(MouseEvent::Up(MouseUp {
// before click events, and so the MouseUp events need to be pushed before region: Default::default(),
// MouseClick events. platform_event: e.clone(),
}));
// Synthesize one last drag event to end the drag // Synthesize one last drag event to end the drag
mouse_events.push(MouseEvent::Drag(MouseDrag { mouse_events.push(MouseEvent::Drag(MouseDrag {
@ -626,10 +627,7 @@ impl<'a> WindowContext<'a> {
}, },
end: true, end: true,
})); }));
mouse_events.push(MouseEvent::Up(MouseUp {
region: Default::default(),
platform_event: e.clone(),
}));
mouse_events.push(MouseEvent::UpOut(MouseUpOut { mouse_events.push(MouseEvent::UpOut(MouseUpOut {
region: Default::default(), region: Default::default(),
platform_event: e.clone(), platform_event: e.clone(),