Skip to content

Commit

Permalink
Only update the needed fields for v-form rendering a group (directus#…
Browse files Browse the repository at this point in the history
  • Loading branch information
br41nslug authored May 11, 2022
1 parent 969afbb commit f1252b1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion app/src/components/v-form/v-form.vue
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,14 @@ export default defineComponent({
return field.schema?.is_primary_key || !isDisabled(field);
});
emit('update:modelValue', assign({}, props.modelValue, pick(updates, updatableKeys)));
if (!isNil(props.group)) {
const groupFields = getFieldsForGroup(props.group)
.filter((field) => !field.schema?.is_primary_key && !isDisabled(field))
.map((field) => field.field);
emit('update:modelValue', assign({}, omit(props.modelValue, groupFields), pick(updates, updatableKeys)));
} else {
emit('update:modelValue', pick(assign({}, props.modelValue, updates), updatableKeys));
}
}
function unsetValue(field: Field) {
Expand Down

0 comments on commit f1252b1

Please sign in to comment.