Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
xenithorb opened this issue Jun 14, 2016 · 28 comments · Fixed by #15631
Closed

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

xenithorb opened this issue Jun 14, 2016 · 28 comments · Fixed by #15631
Assignees
Labels
Milestone

Comments

@xenithorb
Copy link
Contributor

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

@monarch
Copy link

monarch commented Jun 14, 2016

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

@geekgonecrazy
Copy link
Contributor

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?

@dkmin
Copy link

dkmin commented Jun 18, 2016

+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.

@xenithorb xenithorb changed the title Copy/Paste from spreadsheet results in image instead of line-broken text (Electron/Chrome only) Copy/Paste from spreadsheet results in image instead of line-broken text May 11, 2017
@xenithorb
Copy link
Contributor Author

xenithorb commented May 11, 2017

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

@dmotors
Copy link

dmotors commented Nov 11, 2017

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

@JSzaszvari
Copy link
Contributor

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

Even just 1 cell being pasted results in

image

@mfraiss
Copy link

mfraiss commented Nov 28, 2017

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+

@JSzaszvari
Copy link
Contributor

@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.

@geekgonecrazy
Copy link
Contributor

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

@hduarte
Copy link

hduarte commented Mar 15, 2018

Still affects 0.62.1

@Nosferous
Copy link

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

@JSzaszvari
Copy link
Contributor

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

@Sing-Li
Copy link
Member

Sing-Li commented Apr 12, 2018

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

@Nosferous
Copy link

Nosferous commented Apr 27, 2018

@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.

@erfindel
Copy link

erfindel commented Jul 5, 2018

Any update ?

@evant89
Copy link

evant89 commented Oct 8, 2018

Is the problem resolved?

@slajerek
Copy link

The problem is still alive in 0.65.1

@starso
Copy link

starso commented Mar 13, 2019

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

@mmickelson
Copy link

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.

@mfraiss
Copy link

mfraiss commented May 6, 2019

@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.

@nodje
Copy link

nodje commented May 7, 2019

I second @mmickelson , default paste to text and give the option to create a pic/keep the format when needed would be best.
Still doesn't work on Macos

@Sing-Li Sing-Li added this to the 1.5.0 milestone Aug 1, 2019
@Sing-Li Sing-Li added the Triaged label Aug 1, 2019
@engelgabriel
Copy link
Member

We should loop the clipboard array and open a modal window for the users to choose what version of the content they want to use. Plain text on the message input or a file to upload.

@mmickelson
Copy link

@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 The trouble I see with pasting a table as an image is that you wouldn't be able to select the text. When pasting from Excel to Word or Outlook, the text is still selectable. Unless the clipboard contains an image, I struggle to find a scenario that would make the most sense to paste an image of what was copied.

IMHO, pasting a table into rocket should at a minimum paste comma or tab-delimited text. I don't think users should expect to paste in a fully formatted, exact copy of the Excel table. This is because the reason for pasting a table is usually to copy the data, not the aesthetic look of the table. If you want to give someone the fully formatted table, send them the flippin' file.

Are there any other apps in existence that paste an image of text? I think it's standard to paste text for a reason.

@engelgabriel Although the feature of converting text to an image is nifty, I would have to push for the default behavior to just be pasting text unless the clipboard content is an image. A modal would just get in the way. This sounds like a case of adding a feature that shouldn't be there but the developers want to keep because of the time put into it.

Again, think about the reason a user pastes text. Is it to show someone what the text looks like in another app? I think it's because they want to share the information or data that often needs to be selectable and copyable.

@marxst
Copy link

marxst commented Oct 10, 2019

Hi,
I have the same problem here, after I have introduced RocketChat as company wide communication tool, unfortunately the CEO discovered this (and doesn't like it). I would like to back @mmickelson and ask if someone has already done a fix for this or if it is still discussed, how to solve the problem? If I would want to just switch off the image generating code (given that this is possible for me with my limited skills ;-)) where would I have to start looking?

@reetp
Copy link

reetp commented Oct 10, 2019

I just tested on Linux Chromium Version 77.0.3865.90

Ctrl + Shift + V pastes as text

Shift + V pastes as image

See this (I have highlighted the text to show it is text and can be copied again):

Screenshot_2019-10-10_11-31-27

@marxst
Copy link

marxst commented Oct 10, 2019

Unfortunately the company runs on MACs and we are using the native app. I will give a more detailed report on versions as soon as I have access to my MAC, as I am currently using Linux ;-) where everything works fine so far.

@marxst
Copy link

marxst commented Oct 11, 2019

Summary for Pasting from Office as plain Text on a Mac:

Native Client: no way, always as picture 😞 (version 2.15.5)
Firefox: CMD+V results in plaintext (version 69.0.1)
Chrome: CMD+V results in picture, CMD+Shift+V results in plaintext (version 77.0.3865.90)
Safari: CMD+V results in plaintext (version 13.0.2)

Rocket Chat is in Version 1.1.2

@engelgabriel engelgabriel modified the milestones: 2.1.0, 2.2.0 Oct 13, 2019
@tassoevan
Copy link
Contributor

Anything coming from Excel over clipboard has four MIME types:

  1. text/plain;
  2. text/html;
  3. text/rtf;
  4. image/png.

IMO having a text/plain content is sufficient to NOT use the image/png one since the message box doesn't support rich text, but (1) I'm not sure if there are users out there which like the option to paste an image from Office documents and (2) we need to ensure that no exotic browser/OS combination attaches text/plain to any clipboard images.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet