Skip to content

Commit

Permalink
Revert "Modal form change proposal (#416)"
Browse files Browse the repository at this point in the history
This reverts commit 3c21419.
  • Loading branch information
benjitrosch authored Sep 15, 2023
1 parent 3c21419 commit 6f43241
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 21 deletions.
30 changes: 11 additions & 19 deletions src/Modal/Modal.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ export const Default: Story<ModalProps> = (args) => {
Press ESC key or click the button below to close
</Modal.Body>
<Modal.Actions>
<form method="dialog">
<Button>Close</Button>
</form>
<Button>Close</Button>
</Modal.Actions>
</Modal>
</div>
Expand Down Expand Up @@ -60,16 +58,14 @@ export const CloseButton: Story<ModalProps> = (args) => {
<div className="font-sans">
<Button onClick={handleShow}>Open Modal</Button>
<Modal {...args} ref={ref}>
<form method="dialog">
<Button
size="sm"
color="ghost"
shape="circle"
className="absolute right-2 top-2"
>
x
</Button>
</form>
<Button
size="sm"
color="ghost"
shape="circle"
className="absolute right-2 top-2"
>
x
</Button>
<Modal.Header className="font-bold">Hello!</Modal.Header>
<Modal.Body>Press ESC key or click on X button to close</Modal.Body>
</Modal>
Expand All @@ -91,9 +87,7 @@ export const CustomWidth: Story<ModalProps> = (args) => {
Press ESC key or click the button below to close
</Modal.Body>
<Modal.Actions>
<form method="dialog">
<Button>Close</Button>
</form>
<Button>Close</Button>
</Modal.Actions>
</Modal>
</div>
Expand All @@ -113,9 +107,7 @@ export const UseDialogHook: Story<ModalProps> = (args) => {
<Modal.Header className="font-bold">Hello!</Modal.Header>
<Modal.Body>This modal works with useDialog hook!</Modal.Body>
<Modal.Actions>
<form method="dialog">
<Button>Close</Button>
</form>
<Button>Close</Button>
</Modal.Actions>
</Dialog>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/Modal/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ const Modal = forwardRef<HTMLDialogElement, ModalProps>(
className={containerClasses}
ref={ref}
>
<div data-theme={dataTheme} className={bodyClasses}>
<form method="dialog" data-theme={dataTheme} className={bodyClasses}>
{children}
</div>
</form>
{backdrop && (
<form method="dialog" className="modal-backdrop">
<button>close</button>
Expand Down

0 comments on commit 6f43241

Please sign in to comment.