Rocket.Chat icon indicating copy to clipboard operation
Rocket.Chat copied to clipboard

Copy/Paste from spreadsheet results in image instead of line-broken text

Open xenithorb opened this issue 10 years ago • 28 comments

Your Rocket.Chat version: 0.33.0

Firstly I'm filing this against R.C instead of R.C.E because this also happens with Chrome/Chromium as well as Electron. This leads me to believe it is a bug to do with how the application interfaces with the browser based on which browser it is.

The issue is that whenever someone attempts to paste from a spreadsheet program, be it LibreOffice or Microsoft Excel, it results in grabbing the image MIME object from the clipboard instead of the text object.

Being able to test other sites in Chrome/Chromium, this does not happen on other sites like google's input box or pastebin.com's. The clipboard object is correctly interpreted as multi-line text.

Test case:

  1. Open up LibreOffice or Microsoft Excel. Make the following text:
    A
    1 Test 1
    2 Test 2
  2. Select A1:A2 (not here, but in the spreadsheet program mind you)
  3. If possible open up Firefox, Chrome, Electron ("Native" Client)
  4. Paste the clipboard into the RC input box, in any channel
  5. Go to http://pastebin.com, now copy the same text.
  6. (Optional) Go to http://www.google.com, paste the same text into their input box

You should observe the following:

  1. Chrome/Chromium/Electron: In RC and RC only:
    • The Image upload dialog appears and RC treats the clipboard object like an image.
    • In both pastebin.com and google.com, the clipboard object is handled properly as text.
  2. In Firefox:
    • The text is correctly pasted as a multi-line text object, as well as for pastebin.com and google.com

Image Examples:

screenshot_20160614_110655 screenshot_20160614_110858 screenshot_20160614_111037

xenithorb avatar Jun 14 '16 15:06 xenithorb

I'm seeing this with Excel 2016 on Chrome Version 51.0.2704.84 m and Electron client running on Windows 10 64-bit

monarch avatar Jun 14 '16 15:06 monarch

Hm... this must have something to do with the rich text stuff. Like how styling is brought over when you copy between office and outlook, etc. So we might need to just strip styling on text?

geekgonecrazy avatar Jun 14 '16 19:06 geekgonecrazy

+1 same here Rock.Chat+ 1.3.1, MS Excel for MAC 15.13.1 , OS X 10.11.4 @geekgonecrazy I think just text will be fine.

dkmin avatar Jun 18 '16 09:06 dkmin

This is still broken. And now it does it in Firefox, too, apparently.

Pasting from LibreOffice Calc or Microsoft Office or OneNote etc still asks to upload an image instead of just simply pasting the text.

I think this should be reclassified as a bug not an improvement (aren't all bug fixes improvements too)? @geekgonecrazy

xenithorb avatar May 11 '17 15:05 xenithorb

0.59.3 still happening... hope there's a way to allow excel copy to paste as plain text instead of image upload

dmotors avatar Nov 11 '17 01:11 dmotors

I'm seeing this when attempting to copy and paste data from excel as well.

Even just 1 cell being pasted results in

image

JSzaszvari avatar Nov 16 '17 12:11 JSzaszvari

Same here on a Mac OSX, version 10.12.6 when copying text from a mailbody within Microsoft Outlook 15.40.

Resulted text will be uploaded as image in the Mac Electron App Rocket Chat+

mfraiss avatar Nov 28 '17 17:11 mfraiss

@geekgonecrazy Do you have any idea what component might be causing this?

I'm willing to try and look into it but i cant pinpoint the component causing it.

JSzaszvari avatar Dec 13 '17 01:12 JSzaszvari

I honestly have no idea. Seems like the conversion must be happening some how client side since shows before the upload.

geekgonecrazy avatar Jan 03 '18 00:01 geekgonecrazy

Still affects 0.62.1

hduarte avatar Mar 15 '18 11:03 hduarte

This is becoming a hot issue where I have RocketChat deployed. It's been an issue for awhile, but not as hot as it is now.

We are currently running RocketChat-Server: 0.62.1 It's hosted on Ubuntu 16.04 LTS

Nosferous avatar Mar 21 '18 19:03 Nosferous

I've been trying to figure this out for a very long time now, still have not managed to find the cause :(

JSzaszvari avatar Apr 12 '18 08:04 JSzaszvari

Can you please try using keyboard to paste ... on Mac OSX ... Shift + Option + Command + V
on Windows ... Control + Shift + V

Sing-Li avatar Apr 12 '18 12:04 Sing-Li

@Sing-Li

On OSX: Command+Shift+V works as a work around to regular Command+V when connected to Rocket.Chat in web browser and if it's loaded in latest versions of Rambox & Franz. Pastes properly as regular text, free from image conversion.

Command+Shift+V/Command+Shift+Option+V does NOT work in Rocket.Chat+ Electron app on OSX. (tested in version 2.10.5)

We do not have any Windows clients really using it so have not ran that test on windows.

Would still be ideal for regular paste commands to not convert to image but regular text. But this is a solution that will cool off some staff members in the meantime.

Nosferous avatar Apr 27 '18 22:04 Nosferous

Any update ?

erfindel avatar Jul 05 '18 15:07 erfindel

Is the problem resolved?

evant89 avatar Oct 08 '18 08:10 evant89

The problem is still alive in 0.65.1

slajerek avatar Nov 26 '18 13:11 slajerek

Not resolved for Mac OSX + Franz or Mac OSX + Chrome. Works as workaround on Mac OSX + Safari

starso avatar Mar 13 '19 08:03 starso

IMO, As stated before, the default behavior for cmd+v should be pasting text.

I wouldn't expect many cases at all where pasting an image of the text would be useful. You could always paste a screenshot if you needed an image. If a user highlights text and copy/paste, then their intention should be obvious since you shouldn't expect a rectangular image from a potentially multi-line, wrapped selection of text.

mmickelson avatar May 06 '19 18:05 mmickelson

@mmickelson Basically you are right, but if you are pasting a table from Excel into an E-Mail or word it also stays readable and formated.

mfraiss avatar May 06 '19 18:05 mfraiss