Skip to content

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

Open
choephix wants to merge 4 commits intoanomalyco:devfrom
choephix:fix/middle-click-tab-close-scrollable
Open

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

Conversation

@choephix
Copy link

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

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

1 participant