Skip to content

Commit

Permalink
stop event propagation when showing context menu (#275)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrmoulton authored Jan 17, 2024
1 parent e74c4c9 commit 3879949
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,8 @@ impl<'a> EventCx<'a> {
Point::new(layout.x0, layout.y1)
};
if let Some(menu) = &self.app_state.view_state(id).popout_menu {
show_context_menu(menu(), Some(bottom_left))
show_context_menu(menu(), Some(bottom_left));
return EventPropagation::Stop;
}
if self.app_state.draggable.contains(&id)
&& self.app_state.drag_start.is_none()
Expand Down Expand Up @@ -880,7 +881,8 @@ impl<'a> EventCx<'a> {
)
};
if let Some(menu) = &self.app_state.view_state(id).context_menu {
show_context_menu(menu(), Some(viewport_event_position))
show_context_menu(menu(), Some(viewport_event_position));
return EventPropagation::Stop;
}
}
}
Expand Down

0 comments on commit 3879949

Please sign in to comment.