Merge pull request #668 from hecrj/fix/propagate-button-events

Propagate `Button` events to contents
This commit is contained in:
Héctor Ramón 2020-12-18 23:30:49 +01:00 committed by GitHub
commit 86361f003c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 { .. }) => {