Skip to content

fix: prevent middle-click autoscroll on tabs#7419

Closed
cryst-hq wants to merge 1 commit intousebruno:mainfrom
cryst-hq:codex/fix-bruno-7398
Closed

fix: prevent middle-click autoscroll on tabs#7419
cryst-hq wants to merge 1 commit intousebruno:mainfrom
cryst-hq:codex/fix-bruno-7398

Conversation

@cryst-hq
Copy link
Copy Markdown
Contributor

@cryst-hq cryst-hq commented Mar 9, 2026

Summary

  • prevent the browser default middle-click action on draggable tabs
  • keep existing middle-click tab-close behavior intact
  • fix the Windows autoscroll cursor appearing while closing tabs

Closes #7398

Summary by CodeRabbit

  • Bug Fixes
    • Fixed tab interaction to prevent unintended default actions when middle-clicking on draggable tabs.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 9, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: fbb4b2f1-ee9d-49f6-b882-a91508967b98

📥 Commits

Reviewing files that changed from the base of the PR and between f123a2b and 737bbe8.

📒 Files selected for processing (1)
  • packages/bruno-app/src/components/RequestTabs/DraggableTab.js

Walkthrough

Adds a middle-click event handler to the draggable tab component to prevent the browser's default autoscroll cursor behavior. The handler calls preventDefault() when the middle mouse button (event.button === 1) is pressed on the tab element.

Changes

Cohort / File(s) Summary
Middle-click Handler
packages/bruno-app/src/components/RequestTabs/DraggableTab.js
Adds onMouseDown event listener that prevents default behavior when middle mouse button is clicked, suppressing the OS autoscroll cursor during tab closure.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🖱️ A middle-click that once went wild,
With autoscroll arrows—unreconciled,
One preventDefault to save the day,
The cursor stays put, hip-hip-hooray! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely describes the primary change: preventing middle-click autoscroll on tabs.
Linked Issues check ✅ Passed The code change directly addresses issue #7398 by preventing the browser's default middle-click behavior that triggers autoscroll, while preserving tab-close functionality.
Out of Scope Changes check ✅ Passed The change is narrowly focused on the DraggableTab component with only a middle-click preventDefault handler added, directly aligned with the linked issue.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@naman-bruno
Copy link
Copy Markdown
Collaborator

Thanks @cryst-hq for the contribution! It looks like this issue has already been resolved with PR #7443. Really appreciate your effort.
thanks again!

@naman-bruno naman-bruno closed this Apr 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Middle-clicking to close a tab occasionally triggers the autoscroll cursor

2 participants