Skip to content

fix(app): middle-click tab close in scrollable tab bar#15081

Merged
nexxeln merged 4 commits intoanomalyco:devfrom
choephix:fix/middle-click-tab-close-scrollable
Feb 26, 2026
Merged

fix(app): middle-click tab close in scrollable tab bar#15081
nexxeln merged 4 commits intoanomalyco:devfrom
choephix:fix/middle-click-tab-close-scrollable

Conversation

@choephix
Copy link
Contributor

Issue for this PR

Closes #15077

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Added a mousedown handler on TabsTrigger that calls preventDefault() on middle-click (button === 1) when onMiddleClick is defined. This stops the browser's autoscroll and lets the existing onAuxClick handler fire correctly.

How did you verify your code works?

Ran OpenCode locally. Opened enough tabs. Middle-clicked. Magic.

Screenshots / recordings

Before:
Image

After:
opencode11

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@nexxeln nexxeln merged commit aae75b3 into anomalyco:dev Feb 26, 2026
9 checks passed
github-actions bot pushed a commit to chrn11/opencode that referenced this pull request Feb 26, 2026
Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
sebishogun pushed a commit to sebishogun/opencode that referenced this pull request Feb 26, 2026
Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
figloalds pushed a commit to figloalds/opencode that referenced this pull request Feb 27, 2026
Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
jonathanmiddleton pushed a commit to jonathanmiddleton/opencode that referenced this pull request Mar 10, 2026
Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Can't close tab via middle click if bar is scrollable

2 participants