Skip to content

Commit

Permalink
Merge pull request #668 from hecrj/fix/propagate-button-events
Browse files Browse the repository at this point in the history
Propagate `Button` events to contents
  • Loading branch information
hecrj authored Dec 18, 2020
2 parents 0e9f649 + 8fb0ede commit 86361f0
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions native/src/widget/button.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,20 @@ where
layout: Layout<'_>,
cursor_position: Point,
messages: &mut Vec<Message>,
_renderer: &Renderer,
_clipboard: Option<&dyn Clipboard>,
renderer: &Renderer,
clipboard: Option<&dyn Clipboard>,
) -> event::Status {
if let event::Status::Captured = self.content.on_event(
event.clone(),
layout.children().next().unwrap(),
cursor_position,
messages,
renderer,
clipboard,
) {
return event::Status::Captured;
}

match event {
Event::Mouse(mouse::Event::ButtonPressed(mouse::Button::Left))
| Event::Touch(touch::Event::FingerPressed { .. }) => {
Expand Down

0 comments on commit 86361f0

Please sign in to comment.