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
copy paste from excel #95
Comments
you should look for \t in your regex. |
I am currently dealing with the same issue. Adding
Help really appreciated! |
@jonicious try pasting the data into an editor that allows you to see all chars, even invisible ones (like sublime text) to see what the seperators are. |
@MathiasLund I got it working like this: http://stackoverflow.com/a/42008610/3276759 cc @wildeyes |
This solution is better: http://stackoverflow.com/a/42008826/3276759 |
Added your answer to FAQ @jonicious. Thank you. |
Hi there,
great repo!!
Is it possible to make a pasteSplit functionality that also handles copy-paste from Excel?
I've tried different regex's but I can't seem to make it work.
this is my code:
<ReactTagsInput addOnPaste={true} pasteSplit={ data => { return data .replace(/[\n\r]/g, ' ') .split(' ') .map(d => d.trim()) }} ref="tags" value={this.state.keywords} onChange={this.handleChange} />
and this is my dummy data from excel:
but doing this regex: [\n\r] splits up all of the words between whitespace.
So for instance: "danish pastry", becomes "danish" and "pastry".
any ideas? thanks! :)
The text was updated successfully, but these errors were encountered: