We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 50d8e2a commit 1321a74Copy full SHA for 1321a74
src/components/tag-input.js
@@ -38,7 +38,16 @@ export default class TagInput extends LitElement {
38
afterPaste(e) {
39
const clipboardData = e.clipboardData || window.clipboardData;
40
const pastedData = clipboardData.getData('Text');
41
- this.value = pastedData ? pastedData.split(',').filter((v) => v.trim() !== '') : '';
+ const pastedArray = pastedData ? pastedData.split(',').filter((v) => v.trim() !== '') : '';
42
+
43
+ if(pastedArray) {
44
+ if (Array.isArray(this.value)) {
45
+ this.value = [...this.value, ...pastedArray];
46
+ }
47
+ else {
48
+ this.value = pastedArray;
49
50
51
e.preventDefault();
52
}
53
0 commit comments