Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/CorePluginsAdmin/vue/src/FormField/FieldText.vue')
-rw-r--r--plugins/CorePluginsAdmin/vue/src/FormField/FieldText.vue14
1 files changed, 9 insertions, 5 deletions
diff --git a/plugins/CorePluginsAdmin/vue/src/FormField/FieldText.vue b/plugins/CorePluginsAdmin/vue/src/FormField/FieldText.vue
index 1625a8bc31..16ec53f02e 100644
--- a/plugins/CorePluginsAdmin/vue/src/FormField/FieldText.vue
+++ b/plugins/CorePluginsAdmin/vue/src/FormField/FieldText.vue
@@ -23,7 +23,7 @@
</template>
<script lang="ts">
-import { defineComponent } from 'vue';
+import { defineComponent, nextTick } from 'vue';
import { debounce } from 'CoreHome';
export default defineComponent({
@@ -65,11 +65,15 @@ export default defineComponent({
onKeydown(event: Event) {
const newValue = (event.target as HTMLInputElement).value;
if (this.modelValue !== newValue) {
- // change to previous value so the parent component can determine if this change should
- // go through
- (event.target as HTMLInputElement).value = this.modelValueText;
-
this.$emit('update:modelValue', newValue);
+
+ nextTick(() => {
+ if ((event.target as HTMLInputElement).value !== this.modelValueText) {
+ // 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.modelValueText;
+ }
+ });
}
},
},