Skip to content

Commit

Permalink
automatically propagate pointer events when scroll end (#380)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrmoulton authored Mar 15, 2024
1 parent da9c744 commit 77a3bae
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/views/scroll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,8 @@ impl Scroll {
if let Some(onscroll) = &self.onscroll {
onscroll(child_viewport);
}
} else {
return None;
}
Some(())
}
Expand Down Expand Up @@ -870,15 +872,15 @@ impl Widget for Scroll {
} else {
delta
};
self.clamp_child_viewport(cx.app_state, self.child_viewport + delta);
let any_change = self.clamp_child_viewport(cx.app_state, self.child_viewport + delta);

// Check if the scroll bars now hover
self.update_hover_states(cx.app_state, pointer_event.pos);

return if !self.propagate_pointer_wheel {
EventPropagation::Stop
} else {
return if self.propagate_pointer_wheel || any_change.is_none() {
EventPropagation::Continue
} else {
EventPropagation::Stop
};
}

Expand Down

0 comments on commit 77a3bae

Please sign in to comment.