Skip to content

Commit 77d29a1

Browse files
DovydasNavickasMartynas Žilinskas
authored andcommitted
Undefined field value is now resolved to ModifierValue object. (#119)
1 parent e2f0402 commit 77d29a1

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

packages/react-forms/src/abstractions/core-field.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,17 +157,20 @@ export abstract class CoreField<TProps extends CoreFieldProps, TState extends Co
157157
};
158158
const parsedValue = this.ParseValue(modifierValue);
159159

160-
const result: ModifierValue = {
161-
Value: this.NormalizeValue(parsedValue.Value)
162-
};
160+
const result: ModifierValue = modifierValue;
161+
162+
result.Value = this.NormalizeValue(parsedValue.Value);
163163

164164
if (parsedValue.TransitionalValue != null) {
165165
result.TransitionalValue = this.NormalizeValue(parsedValue.TransitionalValue);
166166
}
167167

168168
return result;
169169
}
170-
return value;
170+
171+
return {
172+
Value: value
173+
};
171174
}
172175

173176
protected ProcessValueFromStore(value: FieldValue): FieldValue {

0 commit comments

Comments
 (0)