codesandbox / codesandbox/codesandbox-client

Closing a file with the middle mouse button pasts the content of the clipboard to the focused file

Open
#7,771 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
13.6k
Forks
2.4k
Avg merge
6d 19h
Merged PRs (30d)
2

Description

🐛 bug report

Preflight Checklist

  • I have read the Contributing Guidelines for this project.
  • I agree to follow the Code of Conduct that this project
    adheres to.
  • I have searched the issue tracker for an issue that matches the one I want
    to file, without success.

Description of the problem

It seems that whenever closing an open file using the middle mouse button click, the contents of the clipboard are pasted into the file which is currently focused. Note that this does not happen with text copied from an open file, but does happen with text copied from outside the editor (e.g. copying text from the rendered page, copying text from external program). If I copy text from an open codesandbox editor file, this does not get pasted, but rather the text that I had previously copied gets pasted.

See screen recording

CodeSandbox-Bug-MIddleMouseClose-2023-07-13_21 54 34

How has this issue affected you? What are you trying to accomplish?

It's still possible to close the file in a few other ways (clicking the x, right click + close), and these approaches dont suffer from this issue, but I'm in the habit of using the middle-mouse button to close tabs and keep doing it automatically. I just need to Ctrl + z to undo the unintentional paste and I'm back on track.

To Reproduce
  • Create new sandbox (any template will do)
  • Open multiple files, so you have multiple tabs open in the editor
  • Copy some text from outside the program (e.g. copy some text from this bug report)
  • Middle-mouse click one of the file tabs in codesandbox
  • Clipboard content is pasted into the file that remains open
Link to sandbox: link (optional)

I'll omit this since it's happening on every sandbox I've created (note that I'm fairly new to this product and in all honest have only created a few sanboxes)

Your Environment
Software Name/Version
Сodesandbox 595ab751a
Browser Firefox Mozilla Firefox 114.0.2
Operating System Linux Mint 21.1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test is named. Start by reproducing the issue with multiple open file tabs, external clipboard text, and a middle-mouse tab close in Firefox; trace the file-tab close and clipboard handling paths. Done means closing a tab no longer pastes external clipboard content into the remaining focused file.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.