# workspace: Stop middle-click event propagation on tab close \(\#49305\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 8dbef08bbb96406657b6a3659e521e5fbc557131

Requested commit: 8dbef08bbb96406657b6a3659e521e5fbc557131

Commit: 8dbef08bbb96406657b6a3659e521e5fbc557131

Tree: c6b319756ca16545202e026d9e28f7b942ed0b2c

Author: Arthur Jean

Committer: GitHub

## Message

```
workspace: Stop middle-click event propagation on tab close (#49305)

## Summary

- On Linux, middle-clicking a tab to close it also triggered a paste of
the primary selection into the editor behind it, because the event
bubbled to the editor's `mouse_up()` handler
- Added `cx.stop_propagation()` in the `on_aux_click` handler in
`pane.rs` after closing the tab, matching the pattern already used by
the editor's own middle-click handler in `element.rs:1037`

Closes #47381

## Test plan

- [x] `cargo test -p workspace` passes (124 tests, 0 failures)
- [x] Select text in editor (filling primary selection), middle-click a
tab to close it → tab closes, no paste in the editor behind
- [x] Middle-click inside the editor area → still pastes from primary
selection as expected

Release Notes:

- Fixed middle-click on a tab to close it also pasting into the editor
on Linux.
```

## Parents

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

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