Skip to content

Commit

Permalink
fix: aggregate data before submitting untouched form collections
Browse files Browse the repository at this point in the history
  • Loading branch information
jrief committed Feb 13, 2025
1 parent 393687a commit 88f494a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client/django-formset/DjangoFormset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1788,7 +1788,7 @@ export class DjangoFormset implements DjangoFormset {
public readonly showFeedbackMessages: boolean;
private readonly abortController = new AbortController;
private readonly emptyCollectionPrefixes = Array<string>(0);
private data: object|null = null;
private data?: object;

constructor(formset: DjangoFormsetElement) {
this.element = formset;
Expand Down Expand Up @@ -2034,7 +2034,7 @@ export class DjangoFormset implements DjangoFormset {
}
}

if (this.data === null) {
if (this.data === undefined) {
// submit an untouched formset
this.aggregateValues();
}
Expand Down

0 comments on commit 88f494a

Please sign in to comment.