You need to sign in to do that
Don't have an account?
test vijay
How to Prevent user to switch console tab with unsaved changes in Lightning Aura Component
I have a lightning aura component with 2 filed firstname,Lastname and a save button. if user try to switch on another console tab(Not browser tab) then show a message do you want to switch another tab if yes then switch and if no stay user of that page.
I think you can use something like below.
jQuery(window).on('beforeunload', function()
{
return 'Leaving this page will lose your changes. Are you sure?';
}
Please refer to the below links for the same.
http://salesforce.stackexchange.com/questions/23780/how-to-pop-up-alert-to-a-user-when-he-she-navigate-away-from-page-without-saving
Confirming a User Really Wants to Leave a Page with JavaScript
http://michaelwelburn.com/2013/04/08/confirming-a-user-really-wants-to-leave-a-visualforce-page/
Let me know if it helps you and close your query by marking it as solved so that it can help others in the future.
Thanks.