I am implementing the Dialog component and need to show a "are you sure you want to discard" confirmation message when the user attempts to close the dialog.
Is it possible to run logic before closing the Dialog?
I am able to do this with the onCancel property but it appears it only triggers when the cancel button is clicked not when the modal is closed by clicking the overlay when shouldCloseOnOverlayClick is set to true.