I have a requirement that asks the User "Are you sure you want to close the tab? In case you did not save, your answers will be lost" when closing the Lightning Application. Something like a popup that looks like this:
Does anyone know how to achieve this? I have researched about it and some are using the
<script> tag but its not working. Any help would be greatly appreciated.