Checkpoint

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Antonio Scandurra 2024-03-01 19:15:08 +01:00
parent 8847f73af5
commit f52d9f8c24
8 changed files with 138 additions and 139 deletions

View file

@ -252,8 +252,8 @@ impl<M: ManagedView> Element for PopoverMenu<M> {
if let Some(child_hitbox) = *child_hitbox {
// Mouse-downing outside the menu dismisses it, so we don't
// want a click on the toggle to re-open it.
cx.on_mouse_event(move |e: &MouseDownEvent, moused_hitbox, phase, cx| {
if phase == DispatchPhase::Bubble && moused_hitbox == Some(child_hitbox) {
cx.on_mouse_event(move |_: &MouseDownEvent, phase, cx| {
if phase == DispatchPhase::Bubble && child_hitbox.is_hovered(cx) {
cx.stop_propagation()
}
})