Skip to content

Commit

Permalink
Stop overlay events from bubling through (#376)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrmoulton authored Mar 14, 2024
1 parent 2b18378 commit ee55628
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/window_handle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1648,7 +1648,10 @@ impl Widget for WindowView {
for_each: &mut dyn FnMut(&'a mut dyn Widget) -> bool,
) {
for overlay in self.overlays.values_mut().rev() {
for_each(overlay);
if for_each(overlay) {
// if the overlay events are handled we don't need to run the main window events
return;
};
}
for_each(&mut self.main);
}
Expand Down

0 comments on commit ee55628

Please sign in to comment.