Skip to content

Commit

Permalink
docs(modal): update documentation to include dismiss properties (hero…
Browse files Browse the repository at this point in the history
  • Loading branch information
ryo-manba authored Feb 22, 2024
1 parent ac0e564 commit f75174d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion apps/docs/content/components/modal/non-dismissable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default function App() {
return (
<>
<Button onPress={onOpen}>Open Modal</Button>
<Modal isOpen={isOpen} onOpenChange={onOpenChange} isDismissable={false}>
<Modal isOpen={isOpen} onOpenChange={onOpenChange} isDismissable={false} isKeyboardDismissDisabled={true}>
<ModalContent>
{(onClose) => (
<>
Expand Down
7 changes: 5 additions & 2 deletions apps/docs/content/docs/components/modal.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,11 @@ When the modal opens:

### Non-dissmissable

By default the modal can be closed by clicking on the overlay or pressing the <Kbd>Esc</Kbd> key.
You can disable this behavior by setting the `isDismissable` prop to `false`.
By default, the modal can be closed by clicking on the overlay or pressing the <Kbd>Esc</Kbd> key.
You can disable this behavior by setting the following properties:

- Set the `isDismissable` property to `false` to prevent the modal from closing when clicking on the overlay.
- Set the `isKeyboardDismissDisabled` property to `true` to prevent the modal from closing when pressing the Esc key.

<CodeDemo title="Non-dissmissible" files={modalContent.nonDismissable} />

Expand Down

0 comments on commit f75174d

Please sign in to comment.