GA-MO / react-confirm-alert

react component confirm dialog.
https://ga-mo.github.io/react-confirm-alert/demo/
MIT License
272 stars 105 forks source link

Specify custom function for onClose #21

Closed campbellgoe closed 5 years ago

campbellgoe commented 5 years ago

There currently seems to be no way to specify a custom onClose function, i.e. when click outside the modal, and you want to do some custom logic when it closes.

GA-MO commented 5 years ago

@GCDeveloper I think should add new feature to handle when click outside such as onClickOutside

    confirmAlert({
      onClickOutside: () => // Some logic,
      customUI: ({ onClose }) => {
        return (
          <div className='custom-ui'>
            <h1>Are you sure?</h1>
            <p>You want to delete this file?</p>
            <button>No</button>
            <button>Yes, Delete it!</button>
          </div>
        )
      }
    })
GA-MO commented 5 years ago

This issue was solved in version 2.3.0