diff options
author | dizzy <diosmosis@users.noreply.github.com> | 2022-05-24 14:29:05 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-24 14:29:05 +0300 |
commit | 40127074a99641343e2725db2f5add67a8064b9e (patch) | |
tree | 28fbb7f4af78b5fab70d4b3a74f7f3d66a125c5d /plugins/CorePluginsAdmin/vue/src/FormField/FieldCheckbox.vue | |
parent | fdbcb562ef9e200c860fa3d40f664cac873ea8e8 (diff) |
[Vue] add manage goals store to share loaded idGoal with plugin components that extend goal management (#19236)
* add manage goals store to share loaded idGoal with plugin components used to extend goal management
* allow vue-entry components in edit goal template
* for checkbox fields, undo dom property change manually so parent components can determine whether it should go through (vue does not do this automatically itself)
* bump version so plugin tests can use this code
* remove warning from vue when empty template is used for before goal list actions template event
* fix v-for ref issue + do same change to FieldRadio
Diffstat (limited to 'plugins/CorePluginsAdmin/vue/src/FormField/FieldCheckbox.vue')
-rw-r--r-- | plugins/CorePluginsAdmin/vue/src/FormField/FieldCheckbox.vue | 9 |
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); } }, }, |