react-tagsinput
Advanced tools
Comparing version 3.15.0 to 3.15.1
@@ -7,3 +7,3 @@ { | ||
], | ||
"version": "3.15.0", | ||
"version": "3.15.1", | ||
"homepage": "https://github.com/olahol/react-tagsinput", | ||
@@ -10,0 +10,0 @@ "description": "Highly customizable React component for inputing tags", |
@@ -33,1 +33,2 @@ * Ola Holmström (@olahol) | ||
* Lucjan Suski (@methyl) | ||
* Jonas Reitmann (@jonicious) |
{ | ||
"name": "react-tagsinput", | ||
"version": "3.15.0", | ||
"version": "3.15.1", | ||
"description": "Highly customizable React component for inputing tags", | ||
@@ -5,0 +5,0 @@ "main": "react-tagsinput.js", |
@@ -24,3 +24,3 @@ # react-tagsinput | ||
* [How do I fix warning "unknown prop `addTag`"?](#how-do-i-fix-warning-unknown-prop-addtag) | ||
* [How do I copy paste from Excel?](#how-do-i-copy-pages-from-excel) | ||
* [How do I copy paste from Excel?](#how-do-i-copy-paste-from-excel) | ||
* [Component Interface](#component-interface) | ||
@@ -205,2 +205,6 @@ * [Props](#props) | ||
>All you need is to add a CR, carriage return, symbol (it is the default line break style in MS Office documents). | ||
See [answer on Stack Overflow](http://stackoverflow.com/a/42008826/3276759). | ||
Set the `pasteSplit` prop to this function: | ||
@@ -210,16 +214,7 @@ | ||
pasteSplit(data) { | ||
const enterCharCode = String.fromCharCode(13) | ||
if (data.includes(enterCharCode)) { | ||
return data.split(enterCharCode) | ||
} | ||
const separators = [',', ';', '\\(', '\\)', '\\*', '/', ':', '\\?', '\n'] | ||
return data.split(new RegExp(separators.join('|'), 'g')).map(d => d.trim()) | ||
const separators = [',', ';', '\\(', '\\)', '\\*', '/', ':', '\\?', '\n', '\r']; | ||
return data.split(new RegExp(separators.join('|'))).map(d => d.trim()); | ||
} | ||
``` | ||
Credit: @jonicious | ||
http://stackoverflow.com/a/42008610 | ||
## Component Interface | ||
@@ -226,0 +221,0 @@ |
72950
420