Disable closing modal
- Dominant language
- JavaScript
- Stars
- 193
- Forks
- 112
- PR merge metrics
- No merged PRs in 30d
Description
A feature request from @bankimatglobant:
Presently the Modal component closes when a user clicks the greyed out background, or the close "x" button. A client developer may want to disable close-on-click-away, and may even want to remove the close "x" (for example in the case of a dialog where use must make an explicit choice).
**Disabling auto-close on click away**
One possibility is to simply expose the existing, separate click handlers on the vanilla modal component.
```
```
Another possibility is to keep the existing generic callback but provide a prop that disables close on click away.
```
```
**Disabling the close "x"**
There may be a valid use case for removing the close "x". Perhaps it could work by adding a prop like this:
```
```
Any input @recyclerobot @bankimatglobant?
Contributor guide
Assessment
This issue has not been assessed yet.