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/FieldCheckbox.vue')
-rw-r--r--plugins/CorePluginsAdmin/vue/src/FormField/FieldCheckbox.vue9
1 files changed, 7 insertions, 2 deletions
diff --git a/plugins/CorePluginsAdmin/vue/src/FormField/FieldCheckbox.vue b/plugins/CorePluginsAdmin/vue/src/FormField/FieldCheckbox.vue
index b07115f983..3c242e2627 100644
--- a/plugins/CorePluginsAdmin/vue/src/FormField/FieldCheckbox.vue
+++ b/plugins/CorePluginsAdmin/vue/src/FormField/FieldCheckbox.vue
@@ -36,8 +36,13 @@ export default defineComponent({
emits: ['update:modelValue'],
methods: {
onChange(event: Event) {
- if (this.modelValue !== (event.target as HTMLInputElement).checked) {
- this.$emit('update:modelValue', (event.target as HTMLInputElement).checked);
+ const newValue = (event.target as HTMLInputElement).checked;
+ if (this.modelValue !== newValue) {
+ // undo checked change since we want the parent component to decide if it should go
+ // through
+ (event.target as HTMLInputElement).checked = !newValue;
+
+ this.$emit('update:modelValue', newValue);
}
},
},