From b6f37d357fa5e58763d9f9d362d86f9f9efc65f8 Mon Sep 17 00:00:00 2001
From: Duncan McClean <19637309+duncanmcclean@users.noreply.github.com>
Date: Wed, 1 Nov 2023 17:44:08 +0000
Subject: [PATCH] [4.x] Support paste events in Taggable Fieldtype (#8903)
---
resources/js/components/fieldtypes/TagsFieldtype.vue | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/resources/js/components/fieldtypes/TagsFieldtype.vue b/resources/js/components/fieldtypes/TagsFieldtype.vue
index 0065199f3f..b4c50681f4 100644
--- a/resources/js/components/fieldtypes/TagsFieldtype.vue
+++ b/resources/js/components/fieldtypes/TagsFieldtype.vue
@@ -15,13 +15,14 @@
@search:focus="$emit('focus')"
@search:blur="$emit('blur')">
-
+
@@ -72,6 +73,14 @@ export default {
focus() {
this.$refs.input.focus();
},
+
+ onPaste(event) {
+ const pastedValue = event.clipboardData.getData('text');
+
+ this.update([...this.value, ...pastedValue.split(',')]);
+
+ event.preventDefault();
+ },
},
};