Stop propagation when deploying the context menu for a project panel entry (#3965)

This PR fixes an issue where right-click on any project panel entry
would cause the context menu on the root of the project panel
(introduced in #3954) to deploy.

We need to stop propagation in the handler on the inner project panel
list items so that the click event doesn't bubble up the tree.

Release Notes:

- Fixed an issue where the project panel was always deploying the root
context menu rather than on the clicked item.
This commit is contained in:
Marshall Bowers 2024-01-08 20:51:14 -05:00 committed by GitHub
parent 6982b4b42e
commit c40a7f3445
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1433,6 +1433,9 @@ impl ProjectPanel {
}))
.on_secondary_mouse_down(cx.listener(
move |this, event: &MouseDownEvent, cx| {
// Stop propagation to prevent the catch-all context menu for the project
// panel from being deployed.
cx.stop_propagation();
this.deploy_context_menu(event.position, entry_id, cx);
},
)),