Skip to content

Commit

Permalink
fix(react-formio): Fix modal layout and props
Browse files Browse the repository at this point in the history
  • Loading branch information
Romakita committed Feb 23, 2021
1 parent d3ec6aa commit fe4c1b6
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions packages/react-formio/src/components/modal/modal.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ export interface ModalProps extends Record<string, any> {
export function Modal({
show,
children,
closeModal,
closeModal = noop as any,
onClose = noop as any,
title,
footer: ModalFooter,
style,
className,
...props
}: PropsWithChildren<ModalProps>) {
const titleRef = useRef<HTMLDivElement>();
Expand Down Expand Up @@ -59,9 +61,14 @@ export function Modal({
}

return (
<div className='formio-dialog formio-dialog-theme-default component-settings'>
<div
className={
"formio-dialog formio-dialog-theme-default component-settings" +
className
}
>
<div className='formio-dialog-overlay' onClick={onClickClose} />
<div className='formio-dialog-content'>
<div style={style} className={"formio-dialog-content"}>
<div className={"formio-dialog-wrapper"}>
{title ? (
<div
Expand All @@ -87,7 +94,11 @@ export function Modal({
ref={footerRef}
data-testid={"modalFooter"}
>
<ModalFooter {...props} closeModal={closeModal} />
<ModalFooter
{...props}
closeModal={closeModal}
onClose={onClickClose}
/>
</div>
) : null}
</div>
Expand Down

0 comments on commit fe4c1b6

Please sign in to comment.