Skip to content

Commit

Permalink
Make settings object is optional
Browse files Browse the repository at this point in the history
  • Loading branch information
asimonok committed May 17, 2024
1 parent 7360cd4 commit a70b45b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/components/src/components/Form/Form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ export const Form = <TValue extends object>({
value={field.value}
options={field.options}
onChange={(event) => {
if (field.settings.isMulti) {
if (field.settings?.isMulti) {
field.onChange((Array.isArray(event) ? event.map((s) => s.value) : [event.value ?? '']) as never);
} else {
field.onChange(event.value ?? field.value);
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/types/form-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export interface SelectOptions<TObject extends object, TValue> extends BaseOptio
/**
* Settings
*/
settings: Omit<
settings?: Omit<
SelectCommonProps<TValue>,
| 'aria-label'
| 'data-testid'
Expand Down

0 comments on commit a70b45b

Please sign in to comment.