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

TypeError: undefined is not an object (evaluating 'text.length') #36

Closed
Abhishek-Sankey opened this issue Feb 25, 2021 · 7 comments
Closed
Labels
bug Something isn't working

Comments

@Abhishek-Sankey
Copy link

Hey,
I have a form where a user can add multiple fields and one of them is using MentionInput which is not a required field.
When I try to edit the form then I'm getting the below error:
Screenshot 1942-12-06 at 3 50 04 PM

I looked into the code and found the issue. It's in generatePlainTextPart method. When i put a null check for the text then it works fine...
Can you plz look into this? I can create a PR for same

Thanks!

@dabakovich dabakovich added the bug Something isn't working label Feb 25, 2021
@dabakovich
Copy link
Owner

Thanks for your feedback!
Got it, I'll make a new patch update later for this.

@Abhishek-Sankey
Copy link
Author

@dabakovich I've updated the lib to 2.2.3 but still getting the same error...
const generatePlainTextPart = (text, positionOffset = 0) => ({
text,
position: {
start: positionOffset,
end: positionOffset + text.length, // this text is coming as undefine here
},
});

this is in utils.js file..

@Abhishek-Sankey
Copy link
Author

@dabakovich any update on this?

@dabakovich
Copy link
Owner

Not yet.
Please, feel free to create a PR and I will check it.

@dabakovich dabakovich reopened this Mar 1, 2021
@Abhishek-Sankey
Copy link
Author

okay, will create a PR for same

@Abhishek-Sankey
Copy link
Author

@dabakovich created a pull request(#39) for the same. Plz do let me know if you find anything wrong in PR.

dabakovich added a commit that referenced this issue Mar 10, 2021
Add '==' check for null for value.

Fixes #36
Closes #39
@dabakovich
Copy link
Owner

Should be fixed in v2.2.4.
I'm going to close the issue.
Please check it and feel free to re-open the issue if you will get some issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants