# gpui_web: Only cancel the native context menu when the app claims the right-click \(\#60892\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/ed4d201f507ee28733f52b528244c49c6f5a4daf)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: ed4d201f507ee28733f52b528244c49c6f5a4daf

Requested commit: ed4d201f507ee28733f52b528244c49c6f5a4daf

Commit: ed4d201f507ee28733f52b528244c49c6f5a4daf

Tree: cdfb2a6e726a5d59996d26a68418803174b52381

Author: Baris Palaska

Committer: GitHub

## Message

```
gpui_web: Only cancel the native context menu when the app claims the right-click (#60892)

# Objective

The contextmenu listener cancelled the browser's native menu
unconditionally, so pages hosting a gpui app lost right-click entirely
wherever the app showed no menu of its own, and apps that do show one
had no native menu to suppress selectively.

## Solution

Record whether the right-button MouseDown dispatch was consumed (a
handler called stop_propagation, e.g. to open a custom menu) and cancel
the native menu only in that case: app menus win where they exist, the
browser menu everywhere else. Apps opening custom context menus should
mark the triggering mousedown consumed to opt in.

## Testing

Tested locally

## Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

## Showcase

<img width="816" height="288" alt="context menu"
src="https://github.com/user-attachments/assets/c79cd2ef-d465-4431-8461-7a9feb922576"
/>


Release Notes:

- N/A
```

## Parents

- [79d238f6fdde25388786c9690ef10a1d3e0319b3](https://git.cafe/gitcafe/zed/commit/79d238f6fdde25388786c9690ef10a1d3e0319b3?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/ed4d201f507ee28733f52b528244c49c6f5a4daf?format=markdown)
