Merge pull request #1906 from zed-industries/mouse-down-capture-on-click-fix

Fix mouse down falling through popovers
This commit is contained in:
Kay Simmons 2022-11-18 13:10:50 -08:00 committed by GitHub
commit 0c50c0959d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -485,7 +485,7 @@ impl Presenter {
}
// `event_consumed` should only be true if there are any handlers for this event.
let mut event_consumed = false;
let mut event_consumed = event_cx.handled;
if let Some(callbacks) = valid_region.handlers.get(&mouse_event.handler_key()) {
event_consumed = true;
for callback in callbacks {
@ -499,6 +499,8 @@ impl Presenter {
}
}
any_event_handled |= event_cx.handled;
// For bubbling events, if the event was handled, don't continue dispatching.
// This only makes sense for local events which return false from is_capturable.
if event_consumed && mouse_event.is_capturable() {