Skip to content

Commit

Permalink
defautl section layout
Browse files Browse the repository at this point in the history
  • Loading branch information
manojgetwealthy committed Jul 11, 2023
1 parent 5a9aea8 commit ff77a41
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions src/MetaformRenderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export default class MetaFormRenderer extends React.Component<IFormRenderer> {
this.metaform.listener(EVENTS.SUBMIT, (...params) => {
if (this.props.onSubmit) {
this.props.onSubmit(
FormUtils.updateFormData(this.metaform.form, {}, this.props.formatter || {}),
FormUtils.updateFormData(this.metaform.form, {}, this.props.formatter ?? {}),
params
);
}
Expand Down Expand Up @@ -151,9 +151,7 @@ export default class MetaFormRenderer extends React.Component<IFormRenderer> {
validated={this.state.validated}
validate={this.validate}
form={this.metaform.form}
sectionLayout={
this.metaform.formConfig.sectionLayout || (SECTION_LAYOUT.DEFAULT as TSectionLayout)
}
sectionLayout={this.metaform.formConfig?.sectionLayout}
onCustom={this.handleCustom}
onPrevious={this.handlePrevious}
onNext={this.handleNext}
Expand Down
2 changes: 1 addition & 1 deletion src/form/Form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface IProps {
schema: ISchema;
validated: boolean;
form: IForm;
sectionLayout: TSectionLayout;
sectionLayout?: TSectionLayout;
onCustom: (e?: React.MouseEvent) => void;
onPrevious: (e?: React.MouseEvent, data?: IForm) => void;
onNext: () => Promise<boolean | void>;
Expand Down

0 comments on commit ff77a41

Please sign in to comment.