Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

automatically propagate pointer events at scroll end #380

Merged
merged 1 commit into from
Mar 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading