Inquiry Regarding Warning "Leave page? Changes you made will be lost"

Cheuk Him LUI
Tera Contributor

We have created a record producer, made modifications to the Widget, added a "Save as Draft" button. After clicking this button, the data is saved in the background as expected. However, when attempting to navigate away from the page, a warning message appears stating, "Leave page? Changes you made will be lost"

 

Could you please advise on how we can avoid this warning message in the Widget, even we have saved the change in the backend? Specifically, we would like to bypass the prompt when navigating away from the page after clicked "Save as Draft" as we saved the content or when closing it.

 

Thank you for your assistance.

Snipaste_2025-03-31_16-38-39.jpg

1 REPLY 1

Robbie
Kilo Patron
Kilo Patron

Hi @Cheuk Him LUI,

 

This message is actually being controlled and triggered at the browser level. However, you can use the following code in your widget script so as to bypass this step:

 

top.window.onbeforeunload = null;

 

To help others (and for me to gain recognition for my efforts), please mark this response correct by clicking on Accept as Solution and/or Kudos.




Thanks, Robbie