diff --git a/native/src/widget/pane_grid.rs b/native/src/widget/pane_grid.rs index 8eadac48..3ef578bf 100644 --- a/native/src/widget/pane_grid.rs +++ b/native/src/widget/pane_grid.rs @@ -757,7 +757,12 @@ pub fn draw( cursor_position }; - for ((id, pane), layout) in elements.zip(layout.children()) { + // Render picked pane last + let mut elements = elements.zip(layout.children()).collect::>(); + elements + .sort_by_key(|((id, _), _)| picked_pane.map(|(id, _)| id) == Some(*id)); + + for ((id, pane), layout) in elements { match picked_pane { Some((dragging, origin)) if id == dragging => { let bounds = layout.bounds();