Skip to content

Commit

Permalink
Fix checkbox value on form submit
Browse files Browse the repository at this point in the history
  • Loading branch information
AleksandrsKondratjevs committed Oct 26, 2022
1 parent 866c34f commit aabb7be
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/scandipwa/src/util/Form/Extract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ export const getFieldsData = <AsObject extends boolean = false>(
: field.value;

const dateValue = field.getAttribute('data-date');
const formattedValue = dateValue ? getDateValue(dateValue) : value || '';
const formattedValue = dateValue ? getDateValue(dateValue) : value;

if (!excludeEmpty || value) {
output.push({
Expand Down
2 changes: 1 addition & 1 deletion packages/scandipwa/src/util/Form/Form.type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ export type GetFieldsData<AsObject extends boolean = false> = AsObject extends t

export type FieldValue<
T = unknown, isUnknownValue = true,
> = isUnknownValue extends true ? string | number | boolean | Date : T;
> = isUnknownValue extends true ? string | number | boolean | undefined | Date : T;

0 comments on commit aabb7be

Please sign in to comment.