Don't dispatch events to flex children outside of parent flex's bounds
This commit is contained in:
parent
d7342e2875
commit
0214bec7f4
2 changed files with 23 additions and 0 deletions
|
@ -270,6 +270,12 @@ impl Element for Flex {
|
|||
_: &mut Self::PaintState,
|
||||
cx: &mut EventContext,
|
||||
) -> bool {
|
||||
if let Some(position) = event.position() {
|
||||
if !bounds.contains_point(position) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
let mut handled = false;
|
||||
for child in &mut self.children {
|
||||
handled = child.dispatch_event(event, cx) || handled;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue