From e7f37f3e817a13b81f63266df98f2528ef608eaf Mon Sep 17 00:00:00 2001 From: Frederic Laing Date: Fri, 26 Jun 2026 16:11:25 +0200 Subject: [PATCH] fix(popover): forward in-flight pointer events to modal popups so a selection drag started inside still receives its release --- src/widget/popover.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/widget/popover.rs b/src/widget/popover.rs index 57e4568a..c822899d 100644 --- a/src/widget/popover.rs +++ b/src/widget/popover.rs @@ -402,6 +402,26 @@ where && matches!(event, Event::Mouse(_) | Event::Touch(_)) && !cursor_position.is_over(layout.bounds()) { + // Swallow new presses outside the popup, but still forward other + // events so an interaction started inside it (such as a selection + // drag) receives its release once the cursor leaves the bounds. + let is_press = matches!( + event, + Event::Mouse(mouse::Event::ButtonPressed(_)) + | Event::Touch(touch::Event::FingerPressed { .. }) + ); + if !is_press { + self.content.as_widget_mut().update( + self.tree, + event, + layout, + cursor_position, + renderer, + clipboard, + shell, + &layout.bounds(), + ); + } shell.capture_event(); return; }