Release of middle mouse button paste text from clipboard

When I release the middle mouse button it paste text from clipboard. Very strange and annoying. Why and how can I get rid of it? Using Firefox 79 on Ubuntu 20.04.

Edit: I can use Spacebar + Left click and Hold to pan instead. No text is pasted.

2 Likes

Hi,

The problem is the middle paste option in Firefox.
To turn it off do as follow:

  1. open a new tab
  2. type: about:config
  3. Accept the prompt
  4. type middlemouse.paste
  5. change value ā€œtrueā€ to ā€œfalseā€ (double click or switch on the rightside)
  6. restart firefox

Good luck :wink:

14 Likes

I donā€™t think this is a solution, or at least not a solution for those who use the middlemouse.paste function elsewhere.

I donā€™t usually expect to paste text onto a board without a text cursor somewhere inside a text area. The automatic creation of the text area is quite surprising to me.

4 Likes

That solution works, but it will disable all middle-click paste functionality in whole Firefox on all sites! So this breaks filling inputs and other form items in Firefox globally. Is there any way to disable this only for Figma website?

And why in Chromium browsers middle-click paste works right in Figma to scroll, and as paste on other fields?

For example, in Draw-io (Diagrams-Net app) - mouse scroll with middle click works right on Firefox and on Chromium too without pasting. So seems this is a bug in some Figma frontend JS code.

Is there any ideas how this bug can be fixed in Figma, without disabling middle-click paste globally in Firefox?

And solution on Figma side can be simple - donā€™t accept paste after releasing middle mouse button, if there is drag mode enabled.

6 Likes

Wondering if thereā€™s been any movement hereā€¦ I really donā€™t like having to disable middle click across all pages, but middle click + drag is essential functionality for me

3 Likes

Being a new user, I just ran into this issue as well. In my opinion, and like others have said, I donā€™t see why the default middle mouse button event canā€™t be canceled/disabled in favor of the panning function.

Also it seems that this is community forum and not a development ticket. Anyone that finds this page and looking for the same thing should go submit a request here: https://help.figma.com/hc/en-us/requests/new

New user too here, Iā€™m also used to extensively using the middle click for dragging due to habits shaped by Inkscape, Godot, etc. So after finding this thread, I realized I needed I just whipped up a quick greasesmonkey script to fix this unfortunate issue. You need to add the free ā€˜Greasemonkeyā€™ addon to Firefox, then inside it you create a new script and you just paste the code below, reload Figma, and enjoy. Because of the @match comment, the script only affect figma.com and no other website.

What the script does: it simply checks if there is dragging when the middle button is released, and if so, it just cancels the ā€˜pasteā€™ event that comes next.

Hope itā€™s of use to someone else! If so, youā€™re welcome :slight_smile:

FYI Figma people: without this hack Figma is like at least 40% less usable and enjoyable. I think you should really consider fixing the issue, itā€™s been years and I bet itā€™s turned away quite a few other potential clients.

// ==UserScript==
// @name     Fix Figma
// @version  1
// @grant    none
// @match    https://www.figma.com/*
// ==/UserScript==
const middle_button = 1

let nopaste = false

const delta = 6;
let startX;
let startY;

document.addEventListener('mousedown', function (event) {
  startX = event.pageX;
  startY = event.pageY;
});

document.addEventListener('mouseup', function(e) {
    const diffX = Math.abs(e.pageX - startX);
    const diffY = Math.abs(e.pageY - startY);
  	if (diffX < delta && diffY < delta) {
      // It's a click, not a drag
      return false 
  	}
    if (e.button == middle_button) {
      	nopaste = true
    }
    return false;
}, true);

document.addEventListener('paste', function(e) {
    if (nopaste) {
        e.cancelBubble = true;
        e.stopImmediatePropagation();
      	nopaste = false
    }
    return false;
}, true);
5 Likes

I literally just switched to Linux/Firefox today and I was wondering what on earth was going on. Your script is a godsend, thank you for sharing!

This is a serious bug and they really should fix it.

2 Likes

I agree that disabling the functionality in the browser should not be considered a solution. While Iā€™m not using the mouse paste functionality myself, many people do. Disabling a core system functionality because one app isnā€™t set up to work with it properly is not the right way.

Iā€™ve not encountered any other web-based app and middle mouse navigation with this problem, including Figma competitors with far less resources.

1 Like

Thanks man, I was about to do this myself so you saved me quite a bit of figuring out. Iā€™m surprised it hasnā€™t been fixed in Figma when itā€™s such a trivial fix.

Yeah, this was quite annoying and took me a while to figure out what happened until I stumbled upon this thread. I had nothing in clipboard, and a blank text field started appearing all the time. I thought middle mouse button was mapped to some shortcut for a tool within Figma until I reached here.

Switching to ā€˜Hand toolā€™ (h), then Press and hold left mouse button

is what Iā€™m right now doing to workaround this. Maybe, thatā€™s what Figma intended to do ?