fix(popover): forward in-flight pointer events to modal popups so a selection drag started inside still receives its release
This commit is contained in:
parent
13fb598517
commit
e7f37f3e81
1 changed files with 20 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue