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

Fix an error when pasting from .xls file #349

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sonmansu
Copy link

@sonmansu sonmansu commented Apr 26, 2024

This fixes #267

this error happens when pasting value from .xls file (.xlsx is fine)

image

Copy link

netlify bot commented Apr 26, 2024

Deploy Preview for react-datasheet-grid canceled.

Name Link
🔨 Latest commit 4e7e56e
🔍 Latest deploy log https://app.netlify.com/sites/react-datasheet-grid/deploys/662b7072f6e5b60008753f5f

@gouldingken
Copy link

I have the same issue, but I don't see how the commit here fixes the issue. As I understand it, value is undefined, therefore you can't call value.replace at all. A better option might be:
((value?.replace(/[\n\r]+/g, ' ') ?? '').trim() || (null as unknown)) as T,

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

Successfully merging this pull request may close these issues.

Cannot read properties of undefined (reading 'replace') - when pasting from Excel
2 participants