react-datasheet-grid icon indicating copy to clipboard operation
react-datasheet-grid copied to clipboard

Paste data from excel sheet is not working as expected

Open muzaffartp opened this issue 2 years ago • 3 comments

Hello nick-keller!

we are using version 3.6.3 in our application. I even tried version 4.11.2 but getting same issue. when we copy data from excel sheet and past it in data sheet it gets change, some extra spaces and break line "\n" added to it. e.g.: Copied data from excel: TESTING TESTING12345 Resulted data after paste in data sheet: TESTING TESTING12345 (getting following in prePasteValues function : ['TESTING\n TESTING12345'] ).

getting this behavior only for first value in pasted data if copied multiple columns from excel sheet and if first values length is 20 or greater. e.g.: Pasted TESTING TESTING will work fine, TESTING TESTING12345 will get changed as TESTING TESTING12345. and it will work fine if I try to past as plain text or use Ctrl/AppleCtrl + Shift + P for paste data.

muzaffartp avatar Sep 28 '23 07:09 muzaffartp

I ran into this and worked around it by changing the order that the mime types are checked to make text/html the last resort as excel also sends text/plain.

I also noticed that the order the mime types are checked is different if you paste through the context menu vs. ctrl+v

adg-mh avatar Dec 27 '23 17:12 adg-mh

My PR #331 once approved will fix this 🙂.

faseehahmed1 avatar Jan 18 '24 10:01 faseehahmed1

I'm using version 4.11.4 and this is still happening. The values I'm copying doesn't have multiple lines, just single spaces. Please provide at least a workaround because being able to copy from an Excel file is one of the main advantages of this component.

charlymarchiaro avatar Mar 30 '24 17:03 charlymarchiaro