[PR #11686] fix(app): restore middle mouse button click to close review/file tabs #13903

Closed
opened 2026-02-16 18:18:43 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/11686

State: closed
Merged: No


closes #11633

#11070 implemented scrollable tabs in review/file view section, but introduced an issue where middle clicking on a tab would enter scroll mode instead of closing the tab, unless the tabs are not scrollable (too few tabs)

What does this PR do?

This PR fixes the above bug so middle-click closes tabs like before.

The fix: Adding onMouseDown={(e) => { if (e.button === 1) e.preventDefault() }} prevents the default scroll-mode behavior at the mousedown event, before the browser enters scroll mode

Before

https://github.com/user-attachments/assets/4808a45b-7738-4e8a-962a-06a8dd2b25d8

After

https://github.com/user-attachments/assets/6ea25fe6-9189-4c8f-9eb8-fb4bccc5ac21

How did you verify your code works?

e2e local test suite - same results before/after

manual testing:

  1. create many tabs so they can be scrolled
  2. press middle mouse button on a tab
  3. tab is closed
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/11686 **State:** closed **Merged:** No --- closes #11633 #11070 implemented scrollable tabs in review/file view section, but introduced an issue where middle clicking on a tab would enter scroll mode instead of closing the tab, unless the tabs are not scrollable (too few tabs) ### What does this PR do? This PR fixes the above bug so middle-click closes tabs like before. **The fix**: Adding onMouseDown={(e) => { if (e.button === 1) e.preventDefault() }} prevents the default scroll-mode behavior at the mousedown event, before the browser enters scroll mode ## Before https://github.com/user-attachments/assets/4808a45b-7738-4e8a-962a-06a8dd2b25d8 ## After https://github.com/user-attachments/assets/6ea25fe6-9189-4c8f-9eb8-fb4bccc5ac21 ### How did you verify your code works? e2e local test suite - same results before/after manual testing: 1. create many tabs so they can be scrolled 2. press middle mouse button on a tab 3. tab is closed
yindo added the pull-request label 2026-02-16 18:18:43 -05:00
yindo closed this issue 2026-02-16 18:18:43 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#13903