diff options
Diffstat (limited to 'plugins/CorePluginsAdmin/vue/src/FormField/FieldTextareaArray.vue')
-rw-r--r-- | plugins/CorePluginsAdmin/vue/src/FormField/FieldTextareaArray.vue | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/plugins/CorePluginsAdmin/vue/src/FormField/FieldTextareaArray.vue b/plugins/CorePluginsAdmin/vue/src/FormField/FieldTextareaArray.vue index 48ea1002f2..510f0f68d7 100644 --- a/plugins/CorePluginsAdmin/vue/src/FormField/FieldTextareaArray.vue +++ b/plugins/CorePluginsAdmin/vue/src/FormField/FieldTextareaArray.vue @@ -24,7 +24,7 @@ </template> <script lang="ts"> -import { defineComponent } from 'vue'; +import { defineComponent, nextTick } from 'vue'; import { debounce } from 'CoreHome'; const SEPARATOR = '\n'; @@ -54,11 +54,15 @@ export default defineComponent({ onKeydown(event: KeyboardEvent) { const value = (event.target as HTMLTextAreaElement).value.split(SEPARATOR); if (value.join(SEPARATOR) !== this.concattedValue) { - // change to previous value so the parent component can determine if this change should - // go through - (event.target as HTMLInputElement).value = this.concattedValue; - this.$emit('update:modelValue', value); + + nextTick(() => { + if ((event.target as HTMLInputElement).value !== this.concattedValue) { + // 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.concattedValue; + } + }); } }, }, |