(react) add closeOnEsc props to Modal

We want to be able to disable closing modals by pressing escape in
some cases.
This commit is contained in:
Nathan Vasse
2024-04-23 12:01:47 +02:00
committed by NathanVss
parent 2916dd2af9
commit 285cf99681
4 changed files with 63 additions and 1 deletions

View File

@@ -149,6 +149,12 @@ You can change this behavior by passing the `closeOnClickOutside` prop.
<Canvas of={Stories.CloseOnClickOutside} story={{inline: false}}/>
## Close on escape
By default, the modal will be closed when you press the `esc` key. You can change this behavior by passing the `closeOnEsc` prop.
<Canvas of={Stories.DontCloseOnEsc} story={{inline: false}}/>
## Pre Built Modals
As we know that developers love to have handy shortcuts for common use cases, we provide some pre built modals that we