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

Bug: Copy and paste from MS Excel on a Windows machine pastes an extra empty cell #309

Open
haihoang20 opened this issue Nov 19, 2021 · 2 comments

Comments

@haihoang20
Copy link

There's a bug that happens on Windows where copying and pasting multiple cells from MS Excel will paste an extra empty cell. This can unintentionally overwrite existing cells as seen in the screenshot.
image
image

This bug is reproducible on the demo as well https://nadbm.github.io/react-datasheet/

This does not happen on Mac.

@christiankaindl
Copy link

If anyone comes across this issue, it can be easily fixed by using the parsePaste prop on the component, and pass it a modified version of the default function with an added .trim() call:

<DataSheet
  parsePaste={(pastedString) => {
    return pastedString.trim().split(/\r\n|\n|\r/).map(row => row.split('\t'))
  }
/>

Fixed the issue for me

@vanessa-sdt
Copy link

Help please! How do I do this @christiankaindl

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

No branches or pull requests

3 participants