diff options
Diffstat (limited to 'plugins/CorePluginsAdmin/vue/src/FormField/FieldTextArray.vue')
-rw-r--r-- | plugins/CorePluginsAdmin/vue/src/FormField/FieldTextArray.vue | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/plugins/CorePluginsAdmin/vue/src/FormField/FieldTextArray.vue b/plugins/CorePluginsAdmin/vue/src/FormField/FieldTextArray.vue index 70fb296927..e182e95260 100644 --- a/plugins/CorePluginsAdmin/vue/src/FormField/FieldTextArray.vue +++ b/plugins/CorePluginsAdmin/vue/src/FormField/FieldTextArray.vue @@ -24,7 +24,7 @@ </template> <script lang="ts"> -import { defineComponent } from 'vue'; +import { defineComponent, nextTick } from 'vue'; import { debounce } from 'CoreHome'; export default defineComponent({ @@ -54,11 +54,15 @@ export default defineComponent({ onKeydown(event: Event) { const values = (event.target as HTMLInputElement).value.split(',').map((v) => v.trim()); if (values.join(', ') !== this.concattedValues) { - // change to previous value so the parent component can determine if this change should - // go through - (event.target as HTMLInputElement).value = this.concattedValues; - this.$emit('update:modelValue', values); + + nextTick(() => { + if ((event.target as HTMLInputElement).value !== this.concattedValues) { + // change to previous value if the parent component did not update the model value + // (done manually because Vue will not notice if a value does NOT change) + (event.target as HTMLInputElement).value = this.concattedValues; + } + }); } }, }, |