nick-keller / react-datasheet-grid

An Airtable-like / Excel-like component to create beautiful spreadsheets.
MIT License
1.81k stars 170 forks source link

Paste data from excel sheet is not working as expected #319

Open muzaffartp opened 1 year ago

muzaffartp commented 1 year ago

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.

adg-mh commented 10 months ago

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

faseehahmed1 commented 9 months ago

My PR #331 once approved will fix this 🙂.

charlymarchiaro commented 7 months ago

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.